//////////////////////////////////////////////////////////////////////////
public:
	/// <summary>
	/// Copies source 2D array inside of the larger destination array and
	/// makes a border of the specified type (IPL_BORDER_*) around the copied area.
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="offset"></param>
	/// <param name="bordertype"></param>
	static void CopyMakeBorder(IntPtr src, IntPtr dst, NAMESPACE::Point2D32s offset, ImageBorder bordertype, NAMESPACE::Scalar value)
	{
		cvCopyMakeBorder((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), *(CvPoint*)&offset, (int)bordertype, *(CvScalar*)&value);
	}

	/// <summary>
	/// Copies source 2D array inside of the larger destination array and
	/// makes a border of the specified type (IPL_BORDER_*) around the copied area.
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="offset"></param>
	static void CopyMakeBorder(IntPtr src, IntPtr dst, NAMESPACE::Point2D32s offset, ImageBorder bordertype)
	{
		cvCopyMakeBorder((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), *(CvPoint*)&offset, (int)bordertype);
	}

	/// <summary>
	/// Smoothes array (removes noise)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="smoothtype"></param>
	/// <param name="size1"></param>
	/// <param name="size2"></param>
	/// <param name="sigma1"></param>
	static void Smooth(IntPtr src, IntPtr dst, SmoothType smoothtype, int size1, int size2, double sigma1, double sigma2)
	{
		cvSmooth((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)smoothtype, size1, size2, sigma1, sigma2);
	}

	/// <summary>
	/// Smoothes array (removes noise)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="smoothtype"></param>
	/// <param name="size1"></param>
	/// <param name="size2"></param>
	static void Smooth(IntPtr src, IntPtr dst, SmoothType smoothtype, int size1, int size2, double sigma1)
	{
		cvSmooth((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)smoothtype, size1, size2, sigma1);
	}

	/// <summary>
	/// Smoothes array (removes noise)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="smoothtype"></param>
	/// <param name="size1"></param>
	static void Smooth(IntPtr src, IntPtr dst, SmoothType smoothtype, int size1, int size2)
	{
		cvSmooth((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)smoothtype, size1, size2);
	}

	/// <summary>
	/// Smoothes array (removes noise)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="smoothtype"></param>
	static void Smooth(IntPtr src, IntPtr dst, SmoothType smoothtype, int size1)
	{
		cvSmooth((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)smoothtype, size1);
	}

	/// <summary>
	/// Smoothes array (removes noise)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void Smooth(IntPtr src, IntPtr dst, SmoothType smoothtype)
	{
		cvSmooth((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)smoothtype);
	}

	/// <summary>
	/// Smoothes array (removes noise)
	/// </summary>
	/// <param name="src"></param>
	static void Smooth(IntPtr src, IntPtr dst)
	{
		cvSmooth((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// Convolves the image with the kernel
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="kernel"></param>
	static void Filter2D(IntPtr src, IntPtr dst, IntPtr kernel, NAMESPACE::Point2D32s anchor)
	{
		cvFilter2D((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)kernel.ToPointer(), *(CvPoint*)&anchor);
	}

	/// <summary>
	/// Convolves the image with the kernel
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void Filter2D(IntPtr src, IntPtr dst, IntPtr kernel)
	{
		cvFilter2D((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)kernel.ToPointer());
	}

	/// <summary>
	/// Finds integral image: SUM(X,Y) = sum(x<X,y<Y)I(x,y)
	/// </summary>
	/// <param name="image"></param>
	/// <param name="sum"></param>
	/// <param name="sqsum"></param>
	static void Integral(IntPtr image, IntPtr sum, IntPtr sqsum, IntPtr tilted_sum)
	{
		cvIntegral((CvArr*)image.ToPointer(), (CvArr*)sum.ToPointer(), (CvArr*)sqsum.ToPointer(), (CvArr*)tilted_sum.ToPointer());
	}

	/// <summary>
	/// Finds integral image: SUM(X,Y) = sum(x<X,y<Y)I(x,y)
	/// </summary>
	/// <param name="image"></param>
	/// <param name="sum"></param>
	static void Integral(IntPtr image, IntPtr sum, IntPtr sqsum)
	{
		cvIntegral((CvArr*)image.ToPointer(), (CvArr*)sum.ToPointer(), (CvArr*)sqsum.ToPointer());
	}

	/// <summary>
	/// Finds integral image: SUM(X,Y) = sum(x<X,y<Y)I(x,y)
	/// </summary>
	/// <param name="image"></param>
	static void Integral(IntPtr image, IntPtr sum)
	{
		cvIntegral((CvArr*)image.ToPointer(), (CvArr*)sum.ToPointer());
	}

	/// <summary>
	/// Smoothes the input image with gaussian kernel and then down-samples it.
	/// dst_width = floor(src_width/2)[+1],
	/// dst_height = floor(src_height/2)[+1]
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void PyrDown(IntPtr src, IntPtr dst, FilterType filter)
	{
		cvPyrDown((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)filter);
	}

	/// <summary>
	/// Smoothes the input image with gaussian kernel and then down-samples it.
	/// dst_width = floor(src_width/2)[+1],
	/// dst_height = floor(src_height/2)[+1]
	/// </summary>
	/// <param name="src"></param>
	static void PyrDown(IntPtr src, IntPtr dst)
	{
		cvPyrDown((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// Up-samples image and smoothes the result with gaussian kernel.
	/// dst_width = src_width*2,
	/// dst_height = src_height*2
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void PyrUp(IntPtr src, IntPtr dst, FilterType filter)
	{
		cvPyrUp((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)filter);
	}

	/// <summary>
	/// Up-samples image and smoothes the result with gaussian kernel.
	/// dst_width = src_width*2,
	/// dst_height = src_height*2
	/// </summary>
	/// <param name="src"></param>
	static void PyrUp(IntPtr src, IntPtr dst)
	{
		cvPyrUp((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// Builds pyramid for an image
	/// </summary>
	/// <param name="img"></param>
	/// <param name="extra_layers"></param>
	/// <param name="rate"></param>
	/// <param name="layer_sizes"></param>
	/// <param name="bufarr"></param>
	/// <param name="calc"></param>
	/// <returns></returns>
	static IntPtr CreatePyramid(IntPtr img, int extra_layers, double rate, IntPtr layer_sizes, IntPtr bufarr, int calc, FilterType filter)
	{
		return IntPtr(cvCreatePyramid((CvArr*)img.ToPointer(), extra_layers, rate, (CvSize*)layer_sizes.ToPointer(), (CvArr*)bufarr.ToPointer(), calc, (int)filter));
	}

	/// <summary>
	/// Builds pyramid for an image
	/// </summary>
	/// <param name="img"></param>
	/// <param name="extra_layers"></param>
	/// <param name="rate"></param>
	/// <param name="layer_sizes"></param>
	/// <param name="bufarr"></param>
	/// <returns></returns>
	static IntPtr CreatePyramid(IntPtr img, int extra_layers, double rate, IntPtr layer_sizes, IntPtr bufarr, int calc)
	{
		return IntPtr(cvCreatePyramid((CvArr*)img.ToPointer(), extra_layers, rate, (CvSize*)layer_sizes.ToPointer(), (CvArr*)bufarr.ToPointer(), calc));
	}

	/// <summary>
	/// Builds pyramid for an image
	/// </summary>
	/// <param name="img"></param>
	/// <param name="extra_layers"></param>
	/// <param name="rate"></param>
	/// <param name="layer_sizes"></param>
	/// <returns></returns>
	static IntPtr CreatePyramid(IntPtr img, int extra_layers, double rate, IntPtr layer_sizes, IntPtr bufarr)
	{
		return IntPtr(cvCreatePyramid((CvArr*)img.ToPointer(), extra_layers, rate, (CvSize*)layer_sizes.ToPointer(), (CvArr*)bufarr.ToPointer()));
	}

	/// <summary>
	/// Builds pyramid for an image
	/// </summary>
	/// <param name="img"></param>
	/// <param name="extra_layers"></param>
	/// <param name="rate"></param>
	/// <returns></returns>
	static IntPtr CreatePyramid(IntPtr img, int extra_layers, double rate, IntPtr layer_sizes)
	{
		return IntPtr(cvCreatePyramid((CvArr*)img.ToPointer(), extra_layers, rate, (CvSize*)layer_sizes.ToPointer()));
	}

	/// <summary>
	/// Builds pyramid for an image
	/// </summary>
	/// <param name="img"></param>
	/// <param name="extra_layers"></param>
	/// <returns></returns>
	static IntPtr CreatePyramid(IntPtr img, int extra_layers, double rate)
	{
		return IntPtr(cvCreatePyramid((CvArr*)img.ToPointer(), extra_layers, rate));
	}

	/// <summary>
	/// Releases pyramid
	/// </summary>
	/// <param name="pyramid"></param>
	static void ReleasePyramid(IntPtr pyramid, int extra_layers)
	{
		cvReleasePyramid((CvMat***)pyramid.ToPointer(), extra_layers);
	}

	/// <summary>
	/// Splits color or grayscale image into multiple connected components
	/// of nearly the same color/brightness using modification of Burt algorithm.
	/// comp with contain a pointer to sequence (CvSeq)
	/// of connected components (CvConnectedComp)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="storage"></param>
	/// <param name="comp"></param>
	/// <param name="level"></param>
	/// <param name="threshold1"></param>
	static void PyrSegmentation(IntPtr src, IntPtr dst, IntPtr storage, IntPtr comp, int level, double threshold1, double threshold2)
	{
		cvPyrSegmentation((IplImage*)src.ToPointer(), (IplImage*)dst.ToPointer(), (CvMemStorage*)storage.ToPointer(), (CvSeq**)comp.ToPointer(), level, threshold1, threshold2);
	}

	/// <summary>
	/// Filters image using meanshift algorithm
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="sp"></param>
	/// <param name="sr"></param>
	/// <param name="max_level"></param>
	static void PyrMeanShiftFiltering(IntPtr src, IntPtr dst, double sp, double sr, int max_level, NAMESPACE::TermCriteria termcrit)
	{
		cvPyrMeanShiftFiltering((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), sp, sr, max_level, *(CvTermCriteria*)&termcrit);
	}

	/// <summary>
	/// Filters image using meanshift algorithm
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="sp"></param>
	/// <param name="sr"></param>
	static void PyrMeanShiftFiltering(IntPtr src, IntPtr dst, double sp, double sr, int max_level)
	{
		cvPyrMeanShiftFiltering((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), sp, sr, max_level);
	}

	/// <summary>
	/// Filters image using meanshift algorithm
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="sp"></param>
	static void PyrMeanShiftFiltering(IntPtr src, IntPtr dst, double sp, double sr)
	{
		cvPyrMeanShiftFiltering((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), sp, sr);
	}

	/// <summary>
	/// Segments image using seed "markers"
	/// </summary>
	/// <param name="image"></param>
	static void Watershed(IntPtr image, IntPtr markers)
	{
		cvWatershed((CvArr*)image.ToPointer(), (CvArr*)markers.ToPointer());
	}

	/// <summary>
	/// Inpaints the selected region in the image
	/// </summary>
	/// <param name="src"></param>
	/// <param name="inpaint_mask"></param>
	/// <param name="dst"></param>
	/// <param name="inpaintRange"></param>
	static void Inpaint(IntPtr src, IntPtr inpaint_mask, IntPtr dst, double inpaintRange, InpaintType flags)
	{
		cvInpaint((CvArr*)src.ToPointer(), (CvArr*)inpaint_mask.ToPointer(), (CvArr*)dst.ToPointer(), inpaintRange, (int)flags);
	}

	/// <summary>
	/// Calculates an image derivative using generalized Sobel
	/// (aperture_size = 1,3,5,7) or Scharr (aperture_size = -1) operator.
	/// Scharr can be used only for the first dx or dy derivative
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="xorder"></param>
	/// <param name="yorder"></param>
	static void Sobel(IntPtr src, IntPtr dst, int xorder, int yorder, ApertureSize aperture_size)
	{
		cvSobel((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), xorder, yorder, (int)aperture_size);
	}

	/// <summary>
	/// Calculates an image derivative using generalized Sobel
	/// (aperture_size = 1,3,5,7) or Scharr (aperture_size = -1) operator.
	/// Scharr can be used only for the first dx or dy derivative
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="xorder"></param>
	static void Sobel(IntPtr src, IntPtr dst, int xorder, int yorder)
	{
		cvSobel((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), xorder, yorder);
	}

	/// <summary>
	/// Calculates the image Laplacian: (d2/dx + d2/dy)I
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void Laplace(IntPtr src, IntPtr dst, ApertureSize aperture_size)
	{
		cvLaplace((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)aperture_size);
	}

	/// <summary>
	/// Calculates the image Laplacian: (d2/dx + d2/dy)I
	/// </summary>
	/// <param name="src"></param>
	static void Laplace(IntPtr src, IntPtr dst)
	{
		cvLaplace((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// Converts input array pixels from one color space to another
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void CvtColor(IntPtr src, IntPtr dst, ColorMapType code)
	{
		cvCvtColor((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)code);
	}

	/// <summary>
	/// Resizes image (input array is resized to fit the destination array)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void Resize(IntPtr src, IntPtr dst, TransformFlag interpolation)
	{
		cvResize((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)interpolation);
	}

	/// <summary>
	/// Resizes image (input array is resized to fit the destination array)
	/// </summary>
	/// <param name="src"></param>
	static void Resize(IntPtr src, IntPtr dst)
	{
		cvResize((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// Warps image with affine transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="map_matrix"></param>
	/// <param name="flags"></param>
	static void WarpAffine(IntPtr src, IntPtr dst, IntPtr map_matrix, TransformFlag flags, NAMESPACE::Scalar fillval)
	{
		cvWarpAffine((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer(), (int)flags, *(CvScalar*)&fillval);
	}

	/// <summary>
	/// Warps image with affine transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="map_matrix"></param>
	static void WarpAffine(IntPtr src, IntPtr dst, IntPtr map_matrix, TransformFlag flags)
	{
		cvWarpAffine((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer(), (int)flags);
	}

	/// <summary>
	/// Warps image with affine transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void WarpAffine(IntPtr src, IntPtr dst, IntPtr map_matrix)
	{
		cvWarpAffine((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer());
	}

	/// <summary>
	/// Computes affine transform matrix for mapping src[i] to dst[i] (i=0,1,2)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <returns></returns>
	static IntPtr GetAffineTransform(IntPtr src, IntPtr dst, IntPtr map_matrix)
	{
		return IntPtr(cvGetAffineTransform((CvPoint2D32f*)src.ToPointer(), (CvPoint2D32f*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer()));
	}

	/// <summary>
	/// Computes rotation_matrix matrix
	/// </summary>
	/// <param name="center"></param>
	/// <param name="angle"></param>
	/// <param name="scale"></param>
	/// <returns></returns>
	static IntPtr RotationMatrix2D(NAMESPACE::Point2D32f center, double angle, double scale, IntPtr map_matrix)
	{
		return IntPtr(cv2DRotationMatrix(*(CvPoint2D32f*)&center, angle, scale, (CvMat*)map_matrix.ToPointer()));
	}

	/// <summary>
	/// Warps image with perspective (projective) transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="map_matrix"></param>
	/// <param name="flags"></param>
	static void WarpPerspective(IntPtr src, IntPtr dst, IntPtr map_matrix, TransformFlag flags, NAMESPACE::Scalar fillval)
	{
		cvWarpPerspective((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer(), (int)flags, *(CvScalar*)&fillval);
	}

	/// <summary>
	/// Warps image with perspective (projective) transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="map_matrix"></param>
	static void WarpPerspective(IntPtr src, IntPtr dst, IntPtr map_matrix, TransformFlag flags)
	{
		cvWarpPerspective((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer(), (int)flags);
	}

	/// <summary>
	/// Warps image with perspective (projective) transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void WarpPerspective(IntPtr src, IntPtr dst, IntPtr map_matrix)
	{
		cvWarpPerspective((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer());
	}

	/// <summary>
	/// Computes perspective transform matrix for mapping src[i] to dst[i] (i=0,1,2,3)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <returns></returns>
	static IntPtr GetPerspectiveTransform(IntPtr src, IntPtr dst, IntPtr map_matrix)
	{
		return IntPtr(cvGetPerspectiveTransform((CvPoint2D32f*)src.ToPointer(), (CvPoint2D32f*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer()));
	}

	/// <summary>
	/// Performs generic geometric transformation using the specified coordinate maps
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="mapx"></param>
	/// <param name="mapy"></param>
	/// <param name="flags"></param>
	static void Remap(IntPtr src, IntPtr dst, IntPtr mapx, IntPtr mapy, TransformFlag flags, NAMESPACE::Scalar fillval)
	{
		cvRemap((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvArr*)mapx.ToPointer(), (CvArr*)mapy.ToPointer(), (int)flags, *(CvScalar*)&fillval);
	}

	/// <summary>
	/// Performs generic geometric transformation using the specified coordinate maps
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="mapx"></param>
	/// <param name="mapy"></param>
	static void Remap(IntPtr src, IntPtr dst, IntPtr mapx, IntPtr mapy, TransformFlag flags)
	{
		cvRemap((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvArr*)mapx.ToPointer(), (CvArr*)mapy.ToPointer(), (int)flags);
	}

	/// <summary>
	/// Performs generic geometric transformation using the specified coordinate maps
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="mapx"></param>
	static void Remap(IntPtr src, IntPtr dst, IntPtr mapx, IntPtr mapy)
	{
		cvRemap((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvArr*)mapx.ToPointer(), (CvArr*)mapy.ToPointer());
	}

	/// <summary>
	/// Converts mapx & mapy from floating-point to integer formats for cvRemap
	/// </summary>
	/// <param name="mapx"></param>
	/// <param name="mapy"></param>
	/// <param name="mapxy"></param>
	static void ConvertMaps(IntPtr mapx, IntPtr mapy, IntPtr mapxy, IntPtr mapalpha)
	{
		cvConvertMaps((CvArr*)mapx.ToPointer(), (CvArr*)mapy.ToPointer(), (CvArr*)mapxy.ToPointer(), (CvArr*)mapalpha.ToPointer());
	}

	/// <summary>
	/// Performs forward or inverse log-polar image transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="center"></param>
	/// <param name="M"></param>
	static void LogPolar(IntPtr src, IntPtr dst, NAMESPACE::Point2D32f center, double M, TransformFlag flags)
	{
		cvLogPolar((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), *(CvPoint2D32f*)&center, M, (int)flags);
	}

	/// <summary>
	/// Performs forward or inverse log-polar image transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="center"></param>
	static void LogPolar(IntPtr src, IntPtr dst, NAMESPACE::Point2D32f center, double M)
	{
		cvLogPolar((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), *(CvPoint2D32f*)&center, M);
	}

	/// <summary>
	/// Performs forward or inverse linear-polar image transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="center"></param>
	/// <param name="maxRadius"></param>
	static void LinearPolar(IntPtr src, IntPtr dst, NAMESPACE::Point2D32f center, double maxRadius, TransformFlag flags)
	{
		cvLinearPolar((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), *(CvPoint2D32f*)&center, maxRadius, (int)flags);
	}

	/// <summary>
	/// Performs forward or inverse linear-polar image transform
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="center"></param>
	static void LinearPolar(IntPtr src, IntPtr dst, NAMESPACE::Point2D32f center, double maxRadius)
	{
		cvLinearPolar((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), *(CvPoint2D32f*)&center, maxRadius);
	}

	/// <summary>
	/// creates structuring element used for morphological operations
	/// </summary>
	/// <param name="cols"></param>
	/// <param name="rows"></param>
	/// <param name="anchor_x"></param>
	/// <param name="anchor_y"></param>
	/// <param name="shape"></param>
	/// <returns></returns>
	static IntPtr CreateStructuringElementEx(int cols, int rows, int anchor_x, int anchor_y, ShapeType shape, IntPtr values)
	{
		return IntPtr(cvCreateStructuringElementEx(cols, rows, anchor_x, anchor_y, (int)shape, (int*)values.ToPointer()));
	}

	/// <summary>
	/// creates structuring element used for morphological operations
	/// </summary>
	/// <param name="cols"></param>
	/// <param name="rows"></param>
	/// <param name="anchor_x"></param>
	/// <param name="anchor_y"></param>
	/// <returns></returns>
	static IntPtr CreateStructuringElementEx(int cols, int rows, int anchor_x, int anchor_y, ShapeType shape)
	{
		return IntPtr(cvCreateStructuringElementEx(cols, rows, anchor_x, anchor_y, (int)shape));
	}

	/// <summary>
	/// releases structuring element
	/// </summary>
	static void ReleaseStructuringElement(IntPtr element)
	{
		cvReleaseStructuringElement((IplConvKernel**)element.ToPointer());
	}

	/// <summary>
	/// erodes input image (applies minimum filter) one or more times.
	/// If element pointer is NULL, 3x3 rectangular element is used
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="element"></param>
	static void Erode(IntPtr src, IntPtr dst, IntPtr element, int iterations)
	{
		cvErode((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (IplConvKernel*)element.ToPointer(), iterations);
	}

	/// <summary>
	/// erodes input image (applies minimum filter) one or more times.
	/// If element pointer is NULL, 3x3 rectangular element is used
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void Erode(IntPtr src, IntPtr dst, IntPtr element)
	{
		cvErode((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (IplConvKernel*)element.ToPointer());
	}

	/// <summary>
	/// erodes input image (applies minimum filter) one or more times.
	/// If element pointer is NULL, 3x3 rectangular element is used
	/// </summary>
	/// <param name="src"></param>
	static void Erode(IntPtr src, IntPtr dst)
	{
		cvErode((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// dilates input image (applies maximum filter) one or more times.
	/// If element pointer is NULL, 3x3 rectangular element is used
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="element"></param>
	static void Dilate(IntPtr src, IntPtr dst, IntPtr element, int iterations)
	{
		cvDilate((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (IplConvKernel*)element.ToPointer(), iterations);
	}

	/// <summary>
	/// dilates input image (applies maximum filter) one or more times.
	/// If element pointer is NULL, 3x3 rectangular element is used
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void Dilate(IntPtr src, IntPtr dst, IntPtr element)
	{
		cvDilate((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (IplConvKernel*)element.ToPointer());
	}

	/// <summary>
	/// dilates input image (applies maximum filter) one or more times.
	/// If element pointer is NULL, 3x3 rectangular element is used
	/// </summary>
	/// <param name="src"></param>
	static void Dilate(IntPtr src, IntPtr dst)
	{
		cvDilate((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// Performs complex morphological transformation
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="temp"></param>
	/// <param name="element"></param>
	/// <param name="operation"></param>
	static void MorphologyEx(IntPtr src, IntPtr dst, IntPtr temp, IntPtr element, MorphologyMethod operation, int iterations)
	{
		cvMorphologyEx((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvArr*)temp.ToPointer(), (IplConvKernel*)element.ToPointer(), (int)operation, iterations);
	}

	/// <summary>
	/// Performs complex morphological transformation
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="temp"></param>
	/// <param name="element"></param>
	static void MorphologyEx(IntPtr src, IntPtr dst, IntPtr temp, IntPtr element, MorphologyMethod operation)
	{
		cvMorphologyEx((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvArr*)temp.ToPointer(), (IplConvKernel*)element.ToPointer(), (int)operation);
	}

	/// <summary>
	/// Calculates all spatial and central moments up to the 3rd order
	/// </summary>
	/// <param name="arr"></param>
	/// <param name="moments"></param>
	static void Moments(IntPtr arr, IntPtr moments, bool binary)
	{
		cvMoments((CvArr*)arr.ToPointer(), (CvMoments*)moments.ToPointer(), (int)binary);
	}

	/// <summary>
	/// Calculates all spatial and central moments up to the 3rd order
	/// </summary>
	/// <param name="arr"></param>
	static void Moments(IntPtr arr, IntPtr moments)
	{
		cvMoments((CvArr*)arr.ToPointer(), (CvMoments*)moments.ToPointer());
	}

	/// <summary>
	/// Retrieve particular spatial, central or normalized central moments
	/// </summary>
	/// <param name="moments"></param>
	/// <param name="x_order"></param>
	/// <returns></returns>
	static double GetSpatialMoment(IntPtr moments, int x_order, int y_order)
	{
		return cvGetSpatialMoment((CvMoments*)moments.ToPointer(), x_order, y_order);
	}

	/// <summary>
	/// </summary>
	/// <param name="moments"></param>
	/// <param name="x_order"></param>
	/// <returns></returns>
	static double GetCentralMoment(IntPtr moments, int x_order, int y_order)
	{
		return cvGetCentralMoment((CvMoments*)moments.ToPointer(), x_order, y_order);
	}

	/// <summary>
	/// </summary>
	/// <param name="moments"></param>
	/// <param name="x_order"></param>
	/// <returns></returns>
	static double GetNormalizedCentralMoment(IntPtr moments, int x_order, int y_order)
	{
		return cvGetNormalizedCentralMoment((CvMoments*)moments.ToPointer(), x_order, y_order);
	}

	/// <summary>
	/// Calculates 7 Hu's invariants from precalculated spatial and central moments
	/// </summary>
	/// <param name="moments"></param>
	static void GetHuMoments(IntPtr moments, IntPtr hu_moments)
	{
		cvGetHuMoments((CvMoments*)moments.ToPointer(), (CvHuMoments*)hu_moments.ToPointer());
	}

	/// <summary>
	/// Fetches pixels that belong to the specified line segment and stores them to the buffer.
	/// Returns the number of retrieved points.
	/// </summary>
	/// <param name="image"></param>
	/// <param name="pt1"></param>
	/// <param name="pt2"></param>
	/// <param name="buffer"></param>
	/// <returns></returns>
	static int SampleLine(IntPtr image, NAMESPACE::Point2D32s pt1, NAMESPACE::Point2D32s pt2, IntPtr buffer, PixelConnectType connectivity)
	{
		return cvSampleLine((CvArr*)image.ToPointer(), *(CvPoint*)&pt1, *(CvPoint*)&pt2, (void*)buffer.ToPointer(), (int)connectivity);
	}

	/// <summary>
	/// Fetches pixels that belong to the specified line segment and stores them to the buffer.
	/// Returns the number of retrieved points.
	/// </summary>
	/// <param name="image"></param>
	/// <param name="pt1"></param>
	/// <param name="pt2"></param>
	/// <returns></returns>
	static int SampleLine(IntPtr image, NAMESPACE::Point2D32s pt1, NAMESPACE::Point2D32s pt2, IntPtr buffer)
	{
		return cvSampleLine((CvArr*)image.ToPointer(), *(CvPoint*)&pt1, *(CvPoint*)&pt2, (void*)buffer.ToPointer());
	}

	/// <summary>
	/// Retrieves the rectangular image region with specified center from the input array.
	/// dst(x,y) <- src(x + center.x - dst_width/2, y + center.y - dst_height/2).
	/// Values of pixels with fractional coordinates are retrieved using bilinear interpolation
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void GetRectSubPix(IntPtr src, IntPtr dst, NAMESPACE::Point2D32f center)
	{
		cvGetRectSubPix((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), *(CvPoint2D32f*)&center);
	}

	/// <summary>
	/// Retrieves quadrangle from the input array.
	/// matrixarr = ( a11  a12 | b1 )   dst(x,y) <- src(A[x y]' + b)
	/// ( a21  a22 | b2 )   (bilinear interpolation is used to retrieve pixels
	/// with fractional coordinates)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void GetQuadrangleSubPix(IntPtr src, IntPtr dst, IntPtr map_matrix)
	{
		cvGetQuadrangleSubPix((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)map_matrix.ToPointer());
	}

	/// <summary>
	/// Measures similarity between template and overlapped windows in the source image
	/// and fills the resultant image with the measurements
	/// </summary>
	/// <param name="image"></param>
	/// <param name="templ"></param>
	/// <param name="result"></param>
	static void MatchTemplate(IntPtr image, IntPtr templ, IntPtr result, TemplateMatchMethod method)
	{
		cvMatchTemplate((CvArr*)image.ToPointer(), (CvArr*)templ.ToPointer(), (CvArr*)result.ToPointer(), (int)method);
	}

	/// <summary>
	/// Computes earth mover distance between
	/// two weighted point sets (called signatures)
	/// </summary>
	/// <param name="signature1"></param>
	/// <param name="signature2"></param>
	/// <param name="distance_type"></param>
	/// <param name="distance_func"></param>
	/// <param name="cost_matrix"></param>
	/// <param name="flow"></param>
	/// <param name="lower_bound"></param>
	/// <returns></returns>
	static float CalcEMD2(IntPtr signature1, IntPtr signature2, DistanceType distance_type, DistanceFunction^ distance_func, IntPtr cost_matrix, IntPtr flow, IntPtr lower_bound, IntPtr userdata)
	{
		return cvCalcEMD2((CvArr*)signature1.ToPointer(), (CvArr*)signature2.ToPointer(), (int)distance_type,
			(CvDistanceFunction)Marshal::GetFunctionPointerForDelegate(distance_func).ToPointer(), 
			(CvArr*)cost_matrix.ToPointer(), (CvArr*)flow.ToPointer(), (float*)lower_bound.ToPointer(), (void*)userdata.ToPointer());
	}

	/// <summary>
	/// Computes earth mover distance between
	/// two weighted point sets (called signatures)
	/// </summary>
	/// <param name="signature1"></param>
	/// <param name="signature2"></param>
	/// <param name="distance_type"></param>
	/// <param name="distance_func"></param>
	/// <param name="cost_matrix"></param>
	/// <param name="flow"></param>
	/// <returns></returns>
	static float CalcEMD2(IntPtr signature1, IntPtr signature2, DistanceType distance_type, DistanceFunction^ distance_func, IntPtr cost_matrix, IntPtr flow, IntPtr lower_bound)
	{
		return cvCalcEMD2((CvArr*)signature1.ToPointer(), (CvArr*)signature2.ToPointer(), (int)distance_type, 
			(CvDistanceFunction)Marshal::GetFunctionPointerForDelegate(distance_func).ToPointer(), 
			(CvArr*)cost_matrix.ToPointer(), (CvArr*)flow.ToPointer(), (float*)lower_bound.ToPointer());
	}

	/// <summary>
	/// Computes earth mover distance between
	/// two weighted point sets (called signatures)
	/// </summary>
	/// <param name="signature1"></param>
	/// <param name="signature2"></param>
	/// <param name="distance_type"></param>
	/// <param name="distance_func"></param>
	/// <param name="cost_matrix"></param>
	/// <returns></returns>
	static float CalcEMD2(IntPtr signature1, IntPtr signature2, DistanceType distance_type, DistanceFunction^ distance_func, IntPtr cost_matrix, IntPtr flow)
	{
		return cvCalcEMD2((CvArr*)signature1.ToPointer(), (CvArr*)signature2.ToPointer(), (int)distance_type, 
			(CvDistanceFunction)Marshal::GetFunctionPointerForDelegate(distance_func).ToPointer(), 
			(CvArr*)cost_matrix.ToPointer(), (CvArr*)flow.ToPointer());
	}

	/// <summary>
	/// Computes earth mover distance between
	/// two weighted point sets (called signatures)
	/// </summary>
	/// <param name="signature1"></param>
	/// <param name="signature2"></param>
	/// <param name="distance_type"></param>
	/// <param name="distance_func"></param>
	/// <returns></returns>
	static float CalcEMD2(IntPtr signature1, IntPtr signature2, DistanceType distance_type, DistanceFunction^ distance_func, IntPtr cost_matrix)
	{
		return cvCalcEMD2((CvArr*)signature1.ToPointer(), (CvArr*)signature2.ToPointer(), (int)distance_type, 
			(CvDistanceFunction)Marshal::GetFunctionPointerForDelegate(distance_func).ToPointer(), 
			(CvArr*)cost_matrix.ToPointer());
	}

	/// <summary>
	/// Computes earth mover distance between
	/// two weighted point sets (called signatures)
	/// </summary>
	/// <param name="signature1"></param>
	/// <param name="signature2"></param>
	/// <param name="distance_type"></param>
	/// <returns></returns>
	static float CalcEMD2(IntPtr signature1, IntPtr signature2, DistanceType distance_type, DistanceFunction^ distance_func)
	{
		return cvCalcEMD2((CvArr*)signature1.ToPointer(), (CvArr*)signature2.ToPointer(), (int)distance_type, 
			(CvDistanceFunction)Marshal::GetFunctionPointerForDelegate(distance_func).ToPointer());
	}

	/// <summary>
	/// Computes earth mover distance between
	/// two weighted point sets (called signatures)
	/// </summary>
	/// <param name="signature1"></param>
	/// <param name="signature2"></param>
	/// <returns></returns>
	static float CalcEMD2(IntPtr signature1, IntPtr signature2, DistanceType distance_type)
	{
		return cvCalcEMD2((CvArr*)signature1.ToPointer(), (CvArr*)signature2.ToPointer(), (int)distance_type);
	}

	/// <summary>
	/// Retrieves outer and optionally inner boundaries of white (non-zero) connected
	/// components in the black (zero) background
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <param name="first_contour"></param>
	/// <param name="header_size"></param>
	/// <param name="mode"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static int FindContours(IntPtr image, IntPtr storage, IntPtr first_contour, int header_size, ContourRetrMode mode, ContourApproxMethod method, NAMESPACE::Point2D32s offset)
	{
		return cvFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), (CvSeq**)first_contour.ToPointer(), header_size, (int)mode, (int)method, *(CvPoint*)&offset);
	}

	/// <summary>
	/// Retrieves outer and optionally inner boundaries of white (non-zero) connected
	/// components in the black (zero) background
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <param name="first_contour"></param>
	/// <param name="header_size"></param>
	/// <param name="mode"></param>
	/// <returns></returns>
	static int FindContours(IntPtr image, IntPtr storage, IntPtr first_contour, int header_size, ContourRetrMode mode, ContourApproxMethod method)
	{
		return cvFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), (CvSeq**)first_contour.ToPointer(), header_size, (int)mode, (int)method);
	}

	/// <summary>
	/// Retrieves outer and optionally inner boundaries of white (non-zero) connected
	/// components in the black (zero) background
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <param name="first_contour"></param>
	/// <param name="header_size"></param>
	/// <returns></returns>
	static int FindContours(IntPtr image, IntPtr storage, IntPtr first_contour, int header_size, ContourRetrMode mode)
	{
		return cvFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), (CvSeq**)first_contour.ToPointer(), header_size, (int)mode);
	}

	/// <summary>
	/// Retrieves outer and optionally inner boundaries of white (non-zero) connected
	/// components in the black (zero) background
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <param name="first_contour"></param>
	/// <returns></returns>
	static int FindContours(IntPtr image, IntPtr storage, IntPtr first_contour, int header_size)
	{
		return cvFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), (CvSeq**)first_contour.ToPointer(), header_size);
	}

	/// <summary>
	/// Retrieves outer and optionally inner boundaries of white (non-zero) connected
	/// components in the black (zero) background
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <returns></returns>
	static int FindContours(IntPtr image, IntPtr storage, IntPtr first_contour)
	{
		return cvFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), (CvSeq**)first_contour.ToPointer());
	}

	/// <summary>
	/// Initalizes contour retrieving process.
	/// Calls cvStartFindContours.
	/// Calls cvFindNextContour until null pointer is returned
	/// or some other condition becomes true.
	/// Calls cvEndFindContours at the end.
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <param name="header_size"></param>
	/// <param name="mode"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static IntPtr StartFindContours(IntPtr image, IntPtr storage, int header_size, ContourRetrMode mode, ContourApproxMethod method, NAMESPACE::Point2D32s offset)
	{
		CvContourScanner scanner = cvStartFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), header_size, (int)mode, (int)method, *(CvPoint*)&offset);
		return IntPtr(scanner);
	}

	/// <summary>
	/// Initalizes contour retrieving process.
	/// Calls cvStartFindContours.
	/// Calls cvFindNextContour until null pointer is returned
	/// or some other condition becomes true.
	/// Calls cvEndFindContours at the end.
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <param name="header_size"></param>
	/// <param name="mode"></param>
	/// <returns></returns>
	static IntPtr StartFindContours(IntPtr image, IntPtr storage, int header_size, ContourRetrMode mode, ContourApproxMethod method)
	{
		CvContourScanner scanner = cvStartFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), header_size, (int)mode, (int)method);
		return IntPtr(scanner);
	}

	/// <summary>
	/// Initalizes contour retrieving process.
	/// Calls cvStartFindContours.
	/// Calls cvFindNextContour until null pointer is returned
	/// or some other condition becomes true.
	/// Calls cvEndFindContours at the end.
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <param name="header_size"></param>
	/// <returns></returns>
	static IntPtr StartFindContours(IntPtr image, IntPtr storage, int header_size, ContourRetrMode mode)
	{
		CvContourScanner scanner = cvStartFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), header_size, (int)mode);
		return IntPtr(scanner);
	}

	/// <summary>
	/// Initalizes contour retrieving process.
	/// Calls cvStartFindContours.
	/// Calls cvFindNextContour until null pointer is returned
	/// or some other condition becomes true.
	/// Calls cvEndFindContours at the end.
	/// </summary>
	/// <param name="image"></param>
	/// <param name="storage"></param>
	/// <returns></returns>
	static IntPtr StartFindContours(IntPtr image, IntPtr storage, int header_size)
	{
		CvContourScanner scanner = cvStartFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer(), header_size);
		return IntPtr(scanner);
	}

	/// <summary>
	/// Initalizes contour retrieving process.
	/// Calls cvStartFindContours.
	/// Calls cvFindNextContour until null pointer is returned
	/// or some other condition becomes true.
	/// Calls cvEndFindContours at the end.
	/// </summary>
	/// <param name="image"></param>
	/// <returns></returns>
	static IntPtr StartFindContours(IntPtr image, IntPtr storage)
	{
		CvContourScanner scanner = cvStartFindContours((CvArr*)image.ToPointer(), (CvMemStorage*)storage.ToPointer());
		return IntPtr(scanner);
	}

	/// <summary>
	/// Retrieves next contour
	/// </summary>
	/// <returns></returns>
	static IntPtr FindNextContour(IntPtr scanner)
	{
		return IntPtr(cvFindNextContour((CvContourScanner)scanner.ToPointer()));
	}

	/// <summary>
	/// Substitutes the last retrieved contour with the new one
	/// (if the substitutor is null, the last retrieved contour is removed from the tree)
	/// </summary>
	/// <param name="scanner"></param>
	static void SubstituteContour(IntPtr scanner, IntPtr new_contour)
	{
		cvSubstituteContour((CvContourScanner)scanner.ToPointer(), (CvSeq*)new_contour.ToPointer());
	}

	/// <summary>
	/// Releases contour scanner and returns pointer to the first outer contour
	/// </summary>
	/// <returns></returns>
	static IntPtr EndFindContours(IntPtr scanner)
	{
		return IntPtr(cvEndFindContours((CvContourScanner*)scanner.ToPointer()));
	}
	/// <summary>
	/// Approximates a single Freeman chain or a tree of chains to polygonal curves
	/// </summary>
	/// <param name="src_seq"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <param name="parameter"></param>
	/// <param name="minimal_perimeter"></param>
	/// <returns></returns>
	static IntPtr ApproxChains(IntPtr src_seq, IntPtr storage, ContourApproxMethod method, double parameter, int minimal_perimeter, bool recursive)
	{
		return IntPtr(cvApproxChains((CvSeq*)src_seq.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method, parameter, minimal_perimeter, (int)recursive));
	}

	/// <summary>
	/// Approximates a single Freeman chain or a tree of chains to polygonal curves
	/// </summary>
	/// <param name="src_seq"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <param name="parameter"></param>
	/// <returns></returns>
	static IntPtr ApproxChains(IntPtr src_seq, IntPtr storage, ContourApproxMethod method, double parameter, int minimal_perimeter)
	{
		return IntPtr(cvApproxChains((CvSeq*)src_seq.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method, parameter, minimal_perimeter));
	}

	/// <summary>
	/// Approximates a single Freeman chain or a tree of chains to polygonal curves
	/// </summary>
	/// <param name="src_seq"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static IntPtr ApproxChains(IntPtr src_seq, IntPtr storage, ContourApproxMethod method, double parameter)
	{
		return IntPtr(cvApproxChains((CvSeq*)src_seq.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method, parameter));
	}

	/// <summary>
	/// Approximates a single Freeman chain or a tree of chains to polygonal curves
	/// </summary>
	/// <param name="src_seq"></param>
	/// <param name="storage"></param>
	/// <returns></returns>
	static IntPtr ApproxChains(IntPtr src_seq, IntPtr storage, ContourApproxMethod method)
	{
		return IntPtr(cvApproxChains((CvSeq*)src_seq.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method));
	}

	/// <summary>
	/// Approximates a single Freeman chain or a tree of chains to polygonal curves
	/// </summary>
	/// <param name="src_seq"></param>
	/// <returns></returns>
	static IntPtr ApproxChains(IntPtr src_seq, IntPtr storage)
	{
		return IntPtr(cvApproxChains((CvSeq*)src_seq.ToPointer(), (CvMemStorage*)storage.ToPointer()));
	}

	/// <summary>
	/// Initalizes Freeman chain reader.
	/// The reader is used to iteratively get coordinates of all the chain points.
	/// If the Freeman codes should be read as is, a simple sequence reader should be used
	/// </summary>
	/// <param name="chain"></param>
	static void StartReadChainPoints(IntPtr chain, IntPtr reader)
	{
		cvStartReadChainPoints((CvChain*)chain.ToPointer(), (CvChainPtReader*)reader.ToPointer());
	}

	/// <summary>
	/// Retrieves the next chain point
	/// </summary>
	/// <returns></returns>
	static NAMESPACE::Point2D32s ReadChainPoint(IntPtr reader)
	{
		return *(NAMESPACE::Point2D32s*)&cvReadChainPoint((CvChainPtReader*)reader.ToPointer());
	}

	/// <summary>
	/// Calculates optical flow for 2 images using classical Lucas & Kanade algorithm
	/// </summary>
	/// <param name="prev"></param>
	/// <param name="curr"></param>
	/// <param name="win_size"></param>
	/// <param name="velx"></param>
	static void CalcOpticalFlowLK(IntPtr prev, IntPtr curr, NAMESPACE::Size2D32s win_size, IntPtr velx, IntPtr vely)
	{
		cvCalcOpticalFlowLK((CvArr*)prev.ToPointer(), (CvArr*)curr.ToPointer(), *(CvSize*)&win_size, (CvArr*)velx.ToPointer(), (CvArr*)vely.ToPointer());
	}

	/// <summary>
	/// Calculates optical flow for 2 images using block matching algorithm
	/// </summary>
	/// <param name="prev"></param>
	/// <param name="curr"></param>
	/// <param name="block_size"></param>
	/// <param name="shift_size"></param>
	/// <param name="max_range"></param>
	/// <param name="use_previous"></param>
	/// <param name="velx"></param>
	static void CalcOpticalFlowBM(IntPtr prev, IntPtr curr, NAMESPACE::Size2D32s block_size, NAMESPACE::Size2D32s shift_size, NAMESPACE::Size2D32s max_range, bool use_previous, IntPtr velx, IntPtr vely)
	{
		cvCalcOpticalFlowBM((CvArr*)prev.ToPointer(), (CvArr*)curr.ToPointer(), *(CvSize*)&block_size, *(CvSize*)&shift_size, *(CvSize*)&max_range, (int)use_previous, (CvArr*)velx.ToPointer(), (CvArr*)vely.ToPointer());
	}

	/// <summary>
	/// Calculates Optical flow for 2 images using Horn & Schunck algorithm
	/// </summary>
	/// <param name="prev"></param>
	/// <param name="curr"></param>
	/// <param name="use_previous"></param>
	/// <param name="velx"></param>
	/// <param name="vely"></param>
	/// <param name="lambda"></param>
	static void CalcOpticalFlowHS(IntPtr prev, IntPtr curr, bool use_previous, IntPtr velx, IntPtr vely, double lambda, NAMESPACE::TermCriteria criteria)
	{
		cvCalcOpticalFlowHS((CvArr*)prev.ToPointer(), (CvArr*)curr.ToPointer(), (int)use_previous, (CvArr*)velx.ToPointer(), (CvArr*)vely.ToPointer(), lambda, *(CvTermCriteria*)&criteria);
	}
	/// <summary>
	/// It is Lucas & Kanade method, modified to use pyramids.
	/// Also it does several iterations to get optical flow for
	/// every point at every pyramid level.
	/// Calculates optical flow between two images for certain set of points (i.e.
	/// it is a "sparse" optical flow, which is opposite to the previous 3 methods)
	/// </summary>
	/// <param name="prev"></param>
	/// <param name="curr"></param>
	/// <param name="prev_pyr"></param>
	/// <param name="curr_pyr"></param>
	/// <param name="prev_features"></param>
	/// <param name="curr_features"></param>
	/// <param name="count"></param>
	/// <param name="win_size"></param>
	/// <param name="level"></param>
	/// <param name="status"></param>
	/// <param name="track_error"></param>
	/// <param name="criteria"></param>
	static void CalcOpticalFlowPyrLK(IntPtr prev, IntPtr curr, IntPtr prev_pyr, IntPtr curr_pyr, IntPtr prev_features, IntPtr curr_features, int count, NAMESPACE::Size2D32s win_size, int level, IntPtr status, IntPtr track_error, NAMESPACE::TermCriteria criteria, LKFlowFlag flags)
	{
		cvCalcOpticalFlowPyrLK((CvArr*)prev.ToPointer(), (CvArr*)curr.ToPointer(), (CvArr*)prev_pyr.ToPointer(), (CvArr*)curr_pyr.ToPointer(), (CvPoint2D32f*)prev_features.ToPointer(), (CvPoint2D32f*)curr_features.ToPointer(), count, *(CvSize*)&win_size, level, (char*)status.ToPointer(), (float*)track_error.ToPointer(), *(CvTermCriteria*)&criteria, (int)flags);
	}

	/// <summary>
	/// Modification of a previous sparse optical flow algorithm to calculate
	/// affine flow
	/// </summary>
	/// <param name="prev"></param>
	/// <param name="curr"></param>
	/// <param name="prev_pyr"></param>
	/// <param name="curr_pyr"></param>
	/// <param name="prev_features"></param>
	/// <param name="curr_features"></param>
	/// <param name="matrices"></param>
	/// <param name="count"></param>
	/// <param name="win_size"></param>
	/// <param name="level"></param>
	/// <param name="status"></param>
	/// <param name="track_error"></param>
	/// <param name="criteria"></param>
	static void CalcAffineFlowPyrLK(IntPtr prev, IntPtr curr, IntPtr prev_pyr, IntPtr curr_pyr, IntPtr prev_features, IntPtr curr_features, IntPtr matrices, int count, NAMESPACE::Size2D32s win_size, int level, IntPtr status, IntPtr track_error, NAMESPACE::TermCriteria criteria, LKFlowFlag flags)
	{
		cvCalcAffineFlowPyrLK((CvArr*)prev.ToPointer(), (CvArr*)curr.ToPointer(), (CvArr*)prev_pyr.ToPointer(), (CvArr*)curr_pyr.ToPointer(), (CvPoint2D32f*)prev_features.ToPointer(), (CvPoint2D32f*)curr_features.ToPointer(), (float*)matrices.ToPointer(), count, *(CvSize*)&win_size, level, (char*)status.ToPointer(), (float*)track_error.ToPointer(), *(CvTermCriteria*)&criteria, (int)flags);
	}

	/// <summary>
	/// Estimate rigid transformation between 2 images or 2 point sets
	/// </summary>
	/// <param name="A"></param>
	/// <param name="B"></param>
	/// <param name="M"></param>
	/// <returns></returns>
	static int EstimateRigidTransform(IntPtr A, IntPtr B, IntPtr M, bool full_affine)
	{
		return cvEstimateRigidTransform((CvArr*)A.ToPointer(), (CvArr*)B.ToPointer(), (CvMat*)M.ToPointer(), (int)full_affine);
	}

	/// <summary>
	/// Updates motion history image given motion silhouette
	/// </summary>
	/// <param name="silhouette"></param>
	/// <param name="mhi"></param>
	/// <param name="timestamp"></param>
	static void UpdateMotionHistory(IntPtr silhouette, IntPtr mhi, double timestamp, double duration)
	{
		cvUpdateMotionHistory((CvArr*)silhouette.ToPointer(), (CvArr*)mhi.ToPointer(), timestamp, duration);
	}

	/// <summary>
	/// Calculates gradient of the motion history image and fills
	/// a mask indicating where the gradient is valid
	/// </summary>
	/// <param name="mhi"></param>
	/// <param name="mask"></param>
	/// <param name="orientation"></param>
	/// <param name="delta1"></param>
	/// <param name="delta2"></param>
	static void CalcMotionGradient(IntPtr mhi, IntPtr mask, IntPtr orientation, double delta1, double delta2, ApertureSize aperture_size)
	{
		cvCalcMotionGradient((CvArr*)mhi.ToPointer(), (CvArr*)mask.ToPointer(), (CvArr*)orientation.ToPointer(), delta1, delta2, (int)aperture_size);
	}

	/// <summary>
	/// Calculates gradient of the motion history image and fills
	/// a mask indicating where the gradient is valid
	/// </summary>
	/// <param name="mhi"></param>
	/// <param name="mask"></param>
	/// <param name="orientation"></param>
	/// <param name="delta1"></param>
	static void CalcMotionGradient(IntPtr mhi, IntPtr mask, IntPtr orientation, double delta1, double delta2)
	{
		cvCalcMotionGradient((CvArr*)mhi.ToPointer(), (CvArr*)mask.ToPointer(), (CvArr*)orientation.ToPointer(), delta1, delta2);
	}

	/// <summary>
	/// Calculates average motion direction within a selected motion region
	/// (region can be selected by setting ROIs and/or by composing a valid gradient mask
	/// with the region mask)
	/// </summary>
	/// <param name="orientation"></param>
	/// <param name="mask"></param>
	/// <param name="mhi"></param>
	/// <param name="timestamp"></param>
	/// <returns></returns>
	static double CalcGlobalOrientation(IntPtr orientation, IntPtr mask, IntPtr mhi, double timestamp, double duration)
	{
		return cvCalcGlobalOrientation((CvArr*)orientation.ToPointer(), (CvArr*)mask.ToPointer(), (CvArr*)mhi.ToPointer(), timestamp, duration);
	}

	/// <summary>
	/// Splits a motion history image into a few parts corresponding to separate independent motions
	/// (e.g. left hand, right hand)
	/// </summary>
	/// <param name="mhi"></param>
	/// <param name="seg_mask"></param>
	/// <param name="storage"></param>
	/// <param name="timestamp"></param>
	/// <returns></returns>
	static IntPtr SegmentMotion(IntPtr mhi, IntPtr seg_mask, IntPtr storage, double timestamp, double seg_thresh)
	{
		return IntPtr(cvSegmentMotion((CvArr*)mhi.ToPointer(), (CvArr*)seg_mask.ToPointer(), (CvMemStorage*)storage.ToPointer(), timestamp, seg_thresh));
	}

	/// <summary>
	/// Adds image to accumulator
	/// </summary>
	/// <param name="image"></param>
	/// <param name="sum"></param>
	static void Acc(IntPtr image, IntPtr sum, IntPtr mask)
	{
		cvAcc((CvArr*)image.ToPointer(), (CvArr*)sum.ToPointer(), (CvArr*)mask.ToPointer());
	}

	/// <summary>
	/// Adds image to accumulator
	/// </summary>
	/// <param name="image"></param>
	static void Acc(IntPtr image, IntPtr sum)
	{
		cvAcc((CvArr*)image.ToPointer(), (CvArr*)sum.ToPointer());
	}

	/// <summary>
	/// Adds squared image to accumulator
	/// </summary>
	/// <param name="image"></param>
	/// <param name="sqsum"></param>
	static void SquareAcc(IntPtr image, IntPtr sqsum, IntPtr mask)
	{
		cvSquareAcc((CvArr*)image.ToPointer(), (CvArr*)sqsum.ToPointer(), (CvArr*)mask.ToPointer());
	}

	/// <summary>
	/// Adds squared image to accumulator
	/// </summary>
	/// <param name="image"></param>
	static void SquareAcc(IntPtr image, IntPtr sqsum)
	{
		cvSquareAcc((CvArr*)image.ToPointer(), (CvArr*)sqsum.ToPointer());
	}

	/// <summary>
	/// Adds a product of two images to accumulator
	/// </summary>
	/// <param name="image1"></param>
	/// <param name="image2"></param>
	/// <param name="acc"></param>
	static void MultiplyAcc(IntPtr image1, IntPtr image2, IntPtr acc, IntPtr mask)
	{
		cvMultiplyAcc((CvArr*)image1.ToPointer(), (CvArr*)image2.ToPointer(), (CvArr*)acc.ToPointer(), (CvArr*)mask.ToPointer());
	}

	/// <summary>
	/// Adds a product of two images to accumulator
	/// </summary>
	/// <param name="image1"></param>
	/// <param name="image2"></param>
	static void MultiplyAcc(IntPtr image1, IntPtr image2, IntPtr acc)
	{
		cvMultiplyAcc((CvArr*)image1.ToPointer(), (CvArr*)image2.ToPointer(), (CvArr*)acc.ToPointer());
	}

	/// <summary>
	/// Adds image to accumulator with weights: acc = acc*(1-alpha) + image*alpha
	/// </summary>
	/// <param name="image"></param>
	/// <param name="acc"></param>
	/// <param name="alpha"></param>
	static void RunningAvg(IntPtr image, IntPtr acc, double alpha, IntPtr mask)
	{
		cvRunningAvg((CvArr*)image.ToPointer(), (CvArr*)acc.ToPointer(), alpha, (CvArr*)mask.ToPointer());
	}

	/// <summary>
	/// Adds image to accumulator with weights: acc = acc*(1-alpha) + image*alpha
	/// </summary>
	/// <param name="image"></param>
	/// <param name="acc"></param>
	static void RunningAvg(IntPtr image, IntPtr acc, double alpha)
	{
		cvRunningAvg((CvArr*)image.ToPointer(), (CvArr*)acc.ToPointer(), alpha);
	}

	/// <summary>
	/// Implements CAMSHIFT algorithm - determines object position, size and orientation
	/// from the object histogram back project (extension of meanshift)
	/// </summary>
	/// <param name="prob_image"></param>
	/// <param name="window"></param>
	/// <param name="criteria"></param>
	/// <param name="comp"></param>
	/// <returns></returns>
	static int CamShift(IntPtr prob_image, NAMESPACE::Rect window, NAMESPACE::TermCriteria criteria, IntPtr comp, IntPtr box)
	{
		return cvCamShift((CvArr*)prob_image.ToPointer(), *(CvRect*)&window, *(CvTermCriteria*)&criteria, (CvConnectedComp*)comp.ToPointer(), (CvBox2D*)box.ToPointer());
	}

	/// <summary>
	/// Implements CAMSHIFT algorithm - determines object position, size and orientation
	/// from the object histogram back project (extension of meanshift)
	/// </summary>
	/// <param name="prob_image"></param>
	/// <param name="window"></param>
	/// <param name="criteria"></param>
	/// <returns></returns>
	static int CamShift(IntPtr prob_image, NAMESPACE::Rect window, NAMESPACE::TermCriteria criteria, IntPtr comp)
	{
		return cvCamShift((CvArr*)prob_image.ToPointer(), *(CvRect*)&window, *(CvTermCriteria*)&criteria, (CvConnectedComp*)comp.ToPointer());
	}

	/// <summary>
	/// Implements MeanShift algorithm - determines object position
	/// from the object histogram back project
	/// </summary>
	/// <param name="prob_image"></param>
	/// <param name="window"></param>
	/// <param name="criteria"></param>
	/// <returns></returns>
	static int MeanShift(IntPtr prob_image, NAMESPACE::Rect window, NAMESPACE::TermCriteria criteria, IntPtr comp)
	{
		return cvMeanShift((CvArr*)prob_image.ToPointer(), *(CvRect*)&window, *(CvTermCriteria*)&criteria, (CvConnectedComp*)comp.ToPointer());
	}

	/// <summary>
	/// Creates ConDensation filter state
	/// </summary>
	/// <param name="dynam_params"></param>
	/// <param name="measure_params"></param>
	/// <returns></returns>
	static IntPtr CreateConDensation(int dynam_params, int measure_params, int sample_count)
	{
		return IntPtr(cvCreateConDensation(dynam_params, measure_params, sample_count));
	}

	/// <summary>
	/// Releases ConDensation filter state
	/// </summary>
	static void ReleaseConDensation(IntPtr condens)
	{
		cvReleaseConDensation((CvConDensation**)condens.ToPointer());
	}

	/// <summary>
	/// Updates ConDensation filter by time (predict future state of the system)
	/// </summary>
	static void ConDensUpdateByTime(IntPtr condens)
	{
		cvConDensUpdateByTime((CvConDensation*)condens.ToPointer());
	}

	/// <summary>
	/// Initializes ConDensation filter samples
	/// </summary>
	/// <param name="condens"></param>
	/// <param name="lower_bound"></param>
	static void ConDensInitSampleSet(IntPtr condens, IntPtr lower_bound, IntPtr upper_bound)
	{
		cvConDensInitSampleSet((CvConDensation*)condens.ToPointer(), (CvMat*)lower_bound.ToPointer(), (CvMat*)upper_bound.ToPointer());
	}

	/// <summary>
	/// Creates Kalman filter and sets A, B, Q, R and state to some initial values
	/// </summary>
	/// <param name="dynam_params"></param>
	/// <param name="measure_params"></param>
	/// <returns></returns>
	static IntPtr CreateKalman(int dynam_params, int measure_params, int control_params)
	{
		return IntPtr(cvCreateKalman(dynam_params, measure_params, control_params));
	}

	/// <summary>
	/// Creates Kalman filter and sets A, B, Q, R and state to some initial values
	/// </summary>
	/// <param name="dynam_params"></param>
	/// <returns></returns>
	static IntPtr CreateKalman(int dynam_params, int measure_params)
	{
		return IntPtr(cvCreateKalman(dynam_params, measure_params));
	}

	/// <summary>
	/// Releases Kalman filter state
	/// </summary>
	static void ReleaseKalman(IntPtr kalman)
	{
		cvReleaseKalman((CvKalman**)kalman.ToPointer());
	}

	/// <summary>
	/// Updates Kalman filter by time (predicts future state of the system)
	/// </summary>
	/// <param name="kalman"></param>
	/// <returns></returns>
	static IntPtr KalmanPredict(IntPtr kalman, IntPtr control)
	{
		return IntPtr((void*)cvKalmanPredict((CvKalman*)kalman.ToPointer(), (CvMat*)control.ToPointer()));
	}

	/// <summary>
	/// Updates Kalman filter by time (predicts future state of the system)
	/// </summary>
	/// <returns></returns>
	static IntPtr KalmanPredict(IntPtr kalman)
	{
		return IntPtr((void*)cvKalmanPredict((CvKalman*)kalman.ToPointer()));
	}

	/// <summary>
	/// Updates Kalman filter by measurement
	/// (corrects state of the system and internal matrices)
	/// </summary>
	/// <param name="kalman"></param>
	/// <returns></returns>
	static IntPtr KalmanCorrect(IntPtr kalman, IntPtr measurement)
	{
		return IntPtr((void*)cvKalmanCorrect((CvKalman*)kalman.ToPointer(), (CvMat*)measurement.ToPointer()));
	}

	/// <summary>
	/// Initializes Delaunay triangulation
	/// </summary>
	/// <param name="subdiv"></param>
	static void InitSubdivDelaunay2D(IntPtr subdiv, NAMESPACE::Rect rect)
	{
		cvInitSubdivDelaunay2D((CvSubdiv2D*)subdiv.ToPointer(), *(CvRect*)&rect);
	}

	/// <summary>
	/// Creates new subdivision
	/// </summary>
	/// <param name="subdiv_type"></param>
	/// <param name="header_size"></param>
	/// <param name="vtx_size"></param>
	/// <param name="quadedge_size"></param>
	/// <returns></returns>
	static IntPtr CreateSubdiv2D(int subdiv_type, int header_size, int vtx_size, int quadedge_size, IntPtr storage)
	{
		return IntPtr(cvCreateSubdiv2D(subdiv_type, header_size, vtx_size, quadedge_size, (CvMemStorage*)storage.ToPointer()));
	}

	/// <summary>
	/// Inserts new point to the Delaunay triangulation
	/// </summary>
	/// <param name="subdiv"></param>
	/// <returns></returns>
	static IntPtr SubdivDelaunay2DInsert(IntPtr subdiv, NAMESPACE::Point2D32f pt)
	{
		return IntPtr(cvSubdivDelaunay2DInsert((CvSubdiv2D*)subdiv.ToPointer(), *(CvPoint2D32f*)&pt));
	}

	/// <summary>
	/// Locates a point within the Delaunay triangulation (finds the edge
	/// the point is left to or belongs to, or the triangulation point the given
	/// point coinsides with
	/// </summary>
	/// <param name="subdiv"></param>
	/// <param name="pt"></param>
	/// <param name="edge"></param>
	/// <returns></returns>
	static NAMESPACE::Subdiv2DPointLocation Subdiv2DLocate(IntPtr subdiv, NAMESPACE::Point2D32f pt, IntPtr edge, IntPtr vertex)
	{
		return (NAMESPACE::Subdiv2DPointLocation)cvSubdiv2DLocate((CvSubdiv2D*)subdiv.ToPointer(), *(CvPoint2D32f*)&pt, (CvSubdiv2DEdge*)edge.ToPointer(), (CvSubdiv2DPoint**)vertex.ToPointer());
	}

	/// <summary>
	/// Locates a point within the Delaunay triangulation (finds the edge
	/// the point is left to or belongs to, or the triangulation point the given
	/// point coinsides with
	/// </summary>
	/// <param name="subdiv"></param>
	/// <param name="pt"></param>
	/// <returns></returns>
	static NAMESPACE::Subdiv2DPointLocation Subdiv2DLocate(IntPtr subdiv, NAMESPACE::Point2D32f pt, IntPtr edge)
	{
		return (NAMESPACE::Subdiv2DPointLocation)cvSubdiv2DLocate((CvSubdiv2D*)subdiv.ToPointer(), *(CvPoint2D32f*)&pt, (CvSubdiv2DEdge*)edge.ToPointer());
	}

	/// <summary>
	/// Calculates Voronoi tesselation (i.e. coordinates of Voronoi points)
	/// </summary>
	static void CalcSubdivVoronoi2D(IntPtr subdiv)
	{
		cvCalcSubdivVoronoi2D((CvSubdiv2D*)subdiv.ToPointer());
	}

	/// <summary>
	/// Removes all Voronoi points from the tesselation
	/// </summary>
	static void ClearSubdivVoronoi2D(IntPtr subdiv)
	{
		cvClearSubdivVoronoi2D((CvSubdiv2D*)subdiv.ToPointer());
	}

	/// <summary>
	/// Finds the nearest to the given point vertex in subdivision.
	/// </summary>
	/// <param name="subdiv"></param>
	/// <returns></returns>
	static IntPtr FindNearestPoint2D(IntPtr subdiv, NAMESPACE::Point2D32f pt)
	{
		return IntPtr(cvFindNearestPoint2D((CvSubdiv2D*)subdiv.ToPointer(), *(CvPoint2D32f*)&pt));
	}

	/// <summary>
	/// Approximates a single polygonal curve (contour) or
	/// a tree of polygonal curves (contours)
	/// </summary>
	/// <param name="src_seq"></param>
	/// <param name="header_size"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <param name="parameter"></param>
	/// <returns></returns>
	static IntPtr ApproxPoly(IntPtr src_seq, int header_size, IntPtr storage, PolyAproxMethod method, double parameter, int parameter2)
	{
		return IntPtr(cvApproxPoly((void*)src_seq.ToPointer(), header_size, (CvMemStorage*)storage.ToPointer(), (int)method, parameter, parameter2));
	}

	/// <summary>
	/// Approximates a single polygonal curve (contour) or
	/// a tree of polygonal curves (contours)
	/// </summary>
	/// <param name="src_seq"></param>
	/// <param name="header_size"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static IntPtr ApproxPoly(IntPtr src_seq, int header_size, IntPtr storage, PolyAproxMethod method, double parameter)
	{
		return IntPtr(cvApproxPoly((void*)src_seq.ToPointer(), header_size, (CvMemStorage*)storage.ToPointer(), (int)method, parameter));
	}

	/// <summary>
	/// Finds high-curvature points of the contour
	/// </summary>
	/// <param name="contour"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <param name="parameter1"></param>
	/// <param name="parameter2"></param>
	/// <param name="parameter3"></param>
	/// <returns></returns>
	static IntPtr FindDominantPoints(IntPtr contour, IntPtr storage, FindDominantMethod method, double parameter1, double parameter2, double parameter3, double parameter4)
	{
		return IntPtr(cvFindDominantPoints((CvSeq*)contour.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method, parameter1, parameter2, parameter3, parameter4));
	}

	/// <summary>
	/// Finds high-curvature points of the contour
	/// </summary>
	/// <param name="contour"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <param name="parameter1"></param>
	/// <param name="parameter2"></param>
	/// <returns></returns>
	static IntPtr FindDominantPoints(IntPtr contour, IntPtr storage, FindDominantMethod method, double parameter1, double parameter2, double parameter3)
	{
		return IntPtr(cvFindDominantPoints((CvSeq*)contour.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method, parameter1, parameter2, parameter3));
	}

	/// <summary>
	/// Finds high-curvature points of the contour
	/// </summary>
	/// <param name="contour"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <param name="parameter1"></param>
	/// <returns></returns>
	static IntPtr FindDominantPoints(IntPtr contour, IntPtr storage, FindDominantMethod method, double parameter1, double parameter2)
	{
		return IntPtr(cvFindDominantPoints((CvSeq*)contour.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method, parameter1, parameter2));
	}

	/// <summary>
	/// Finds high-curvature points of the contour
	/// </summary>
	/// <param name="contour"></param>
	/// <param name="storage"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static IntPtr FindDominantPoints(IntPtr contour, IntPtr storage, FindDominantMethod method, double parameter1)
	{
		return IntPtr(cvFindDominantPoints((CvSeq*)contour.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method, parameter1));
	}

	/// <summary>
	/// Finds high-curvature points of the contour
	/// </summary>
	/// <param name="contour"></param>
	/// <param name="storage"></param>
	/// <returns></returns>
	static IntPtr FindDominantPoints(IntPtr contour, IntPtr storage, FindDominantMethod method)
	{
		return IntPtr(cvFindDominantPoints((CvSeq*)contour.ToPointer(), (CvMemStorage*)storage.ToPointer(), (int)method));
	}

	/// <summary>
	/// Finds high-curvature points of the contour
	/// </summary>
	/// <param name="contour"></param>
	/// <returns></returns>
	static IntPtr FindDominantPoints(IntPtr contour, IntPtr storage)
	{
		return IntPtr(cvFindDominantPoints((CvSeq*)contour.ToPointer(), (CvMemStorage*)storage.ToPointer()));
	}

	/// <summary>
	/// Calculates perimeter of a contour or length of a part of contour
	/// </summary>
	/// <param name="curve"></param>
	/// <param name="slice"></param>
	/// <returns></returns>
	static double ArcLength(IntPtr curve, NAMESPACE::Slice slice, bool is_closed)
	{
		return cvArcLength((void*)curve.ToPointer(), *(CvSlice*)&slice, (int)is_closed);
	}

	/// <summary>
	/// Calculates perimeter of a contour or length of a part of contour
	/// </summary>
	/// <param name="curve"></param>
	/// <param name="slice"></param>
	/// <returns></returns>
	static double ContourPerimeter(IntPtr curve)
	{
		return cvContourPerimeter((void*)curve.ToPointer());
	}

	/// <summary>
	/// Calculates perimeter of a contour or length of a part of contour
	/// </summary>
	/// <param name="curve"></param>
	/// <returns></returns>
	static double ArcLength(IntPtr curve, NAMESPACE::Slice slice)
	{
		return cvArcLength((void*)curve.ToPointer(), *(CvSlice*)&slice);
	}

	/// <summary>
	/// Calculates perimeter of a contour or length of a part of contour
	/// </summary>
	/// <returns></returns>
	static double ArcLength(IntPtr curve)
	{
		return cvArcLength((void*)curve.ToPointer());
	}

	/// <summary>
	/// Calculates contour boundning rectangle (update=1) or
	/// just retrieves pre-calculated rectangle (update=0)
	/// </summary>
	/// <param name="points"></param>
	/// <returns></returns>
	static NAMESPACE::Rect BoundingRect(IntPtr points, bool update)
	{
		return *(NAMESPACE::Rect*)&cvBoundingRect((CvArr*)points.ToPointer(), (int)update);
	}

	/// <summary>
	/// Calculates contour boundning rectangle (update=1) or
	/// just retrieves pre-calculated rectangle (update=0)
	/// </summary>
	/// <returns></returns>
	static NAMESPACE::Rect BoundingRect(IntPtr points)
	{
		return *(NAMESPACE::Rect*)&cvBoundingRect((CvArr*)points.ToPointer());
	}

	/// <summary>
	/// Calculates area of a contour or contour segment
	/// </summary>
	/// <param name="contour"></param>
	/// <returns></returns>
	static double ContourArea(IntPtr contour, NAMESPACE::Slice slice)
	{
		return cvContourArea((CvArr*)contour.ToPointer(), *(CvSlice*)&slice);
	}

	/// <summary>
	/// Calculates area of a contour or contour segment
	/// </summary>
	/// <returns></returns>
	static double ContourArea(IntPtr contour)
	{
		return cvContourArea((CvArr*)contour.ToPointer());
	}

	/// <summary>
	/// Finds minimum area rotated rectangle bounding a set of points
	/// </summary>
	/// <param name="points"></param>
	/// <returns></returns>
	static NAMESPACE::Box2D MinAreaRect2(IntPtr points, IntPtr storage)
	{
		return *(NAMESPACE::Box2D*)&cvMinAreaRect2((CvArr*)points.ToPointer(), (CvMemStorage*)storage.ToPointer());
	}

	/// <summary>
	/// Finds minimum area rotated rectangle bounding a set of points
	/// </summary>
	/// <returns></returns>
	static NAMESPACE::Box2D MinAreaRect2(IntPtr points)
	{
		return *(NAMESPACE::Box2D*)&cvMinAreaRect2((CvArr*)points.ToPointer());
	}

	/// <summary>
	/// Finds minimum enclosing circle for a set of points
	/// </summary>
	/// <param name="points"></param>
	/// <param name="center"></param>
	/// <returns></returns>
	static int MinEnclosingCircle(IntPtr points, IntPtr center, IntPtr radius)
	{
		return cvMinEnclosingCircle((CvArr*)points.ToPointer(), (CvPoint2D32f*)center.ToPointer(), (float*)radius.ToPointer());
	}

	/// <summary>
	/// Compares two contours by matching their moments
	/// </summary>
	/// <param name="object1"></param>
	/// <param name="object2"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static double MatchShapes(IntPtr object1, IntPtr object2, ContourMatchMethod method, double parameter)
	{
		return cvMatchShapes((void*)object1.ToPointer(), (void*)object2.ToPointer(), (int)method, parameter);
	}

	/// <summary>
	/// Compares two contours by matching their moments
	/// </summary>
	/// <param name="object1"></param>
	/// <param name="object2"></param>
	/// <returns></returns>
	static double MatchShapes(IntPtr object1, IntPtr object2, ContourMatchMethod method)
	{
		return cvMatchShapes((void*)object1.ToPointer(), (void*)object2.ToPointer(), (int)method);
	}

	/// <summary>
	/// Builds hierarhical representation of a contour
	/// </summary>
	/// <param name="contour"></param>
	/// <param name="storage"></param>
	/// <returns></returns>
	static IntPtr CreateContourTree(IntPtr contour, IntPtr storage, double threshold)
	{
		return IntPtr(cvCreateContourTree((CvSeq*)contour.ToPointer(), (CvMemStorage*)storage.ToPointer(), threshold));
	}

	/// <summary>
	/// Reconstruct (completelly or partially) contour a from contour tree
	/// </summary>
	/// <param name="tree"></param>
	/// <param name="storage"></param>
	/// <returns></returns>
	static IntPtr ContourFromContourTree(IntPtr tree, IntPtr storage, NAMESPACE::TermCriteria criteria)
	{
		return IntPtr(cvContourFromContourTree((CvContourTree*)tree.ToPointer(), (CvMemStorage*)storage.ToPointer(), *(CvTermCriteria*)&criteria));
	}

	/// <summary>
	/// </summary>
	/// <param name="tree1"></param>
	/// <param name="tree2"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static double MatchContourTrees(IntPtr tree1, IntPtr tree2, ContourTreeMatchMethod method, double threshold)
	{
		return cvMatchContourTrees((CvContourTree*)tree1.ToPointer(), (CvContourTree*)tree2.ToPointer(), (int)method, threshold);
	}

	/// <summary>
	/// Calculates histogram of a contour
	/// </summary>
	/// <param name="contour"></param>
	static void CalcPGH(IntPtr contour, IntPtr hist)
	{
		cvCalcPGH((CvSeq*)contour.ToPointer(), (CvHistogram*)hist.ToPointer());
	}

	/// <summary>
	/// Calculates exact convex hull of 2d point set
	/// </summary>
	/// <param name="input"></param>
	/// <param name="hull_storage"></param>
	/// <param name="orientation"></param>
	/// <returns></returns>
	static IntPtr ConvexHull2(IntPtr input, IntPtr hull_storage, OrientationType orientation, bool return_points)
	{
		return IntPtr(cvConvexHull2((CvArr*)input.ToPointer(), (void*)hull_storage.ToPointer(), (int)orientation, (int)return_points));
	}

	/// <summary>
	/// Calculates exact convex hull of 2d point set
	/// </summary>
	/// <param name="input"></param>
	/// <param name="hull_storage"></param>
	/// <returns></returns>
	static IntPtr ConvexHull2(IntPtr input, IntPtr hull_storage, OrientationType orientation)
	{
		return IntPtr(cvConvexHull2((CvArr*)input.ToPointer(), (void*)hull_storage.ToPointer(), (int)orientation));
	}

	/// <summary>
	/// Calculates exact convex hull of 2d point set
	/// </summary>
	/// <param name="input"></param>
	/// <returns></returns>
	static IntPtr ConvexHull2(IntPtr input, IntPtr hull_storage)
	{
		return IntPtr(cvConvexHull2((CvArr*)input.ToPointer(), (void*)hull_storage.ToPointer()));
	}

	/// <summary>
	/// Calculates exact convex hull of 2d point set
	/// </summary>
	/// <returns></returns>
	static IntPtr ConvexHull2(IntPtr input)
	{
		return IntPtr(cvConvexHull2((CvArr*)input.ToPointer()));
	}

	/// <summary>
	/// Checks whether the contour is convex or not (returns 1 if convex, 0 if not)
	/// </summary>
	/// <returns></returns>
	static int CheckContourConvexity(IntPtr contour)
	{
		return cvCheckContourConvexity((CvArr*)contour.ToPointer());
	}

	/// <summary>
	/// Finds convexity defects for the contour
	/// </summary>
	/// <param name="contour"></param>
	/// <param name="convexhull"></param>
	/// <returns></returns>
	static IntPtr ConvexityDefects(IntPtr contour, IntPtr convexhull, IntPtr storage)
	{
		return IntPtr(cvConvexityDefects((CvArr*)contour.ToPointer(), (CvArr*)convexhull.ToPointer(), (CvMemStorage*)storage.ToPointer()));
	}

	/// <summary>
	/// Finds convexity defects for the contour
	/// </summary>
	/// <param name="contour"></param>
	/// <returns></returns>
	static IntPtr ConvexityDefects(IntPtr contour, IntPtr convexhull)
	{
		return IntPtr(cvConvexityDefects((CvArr*)contour.ToPointer(), (CvArr*)convexhull.ToPointer()));
	}

	/// <summary>
	/// Fits ellipse into a set of 2d points
	/// </summary>
	/// <returns></returns>
	static NAMESPACE::Box2D FitEllipse2(IntPtr points)
	{
		return *(NAMESPACE::Box2D*)&cvFitEllipse2((CvArr*)points.ToPointer());
	}

	/// <summary>
	/// Finds minimum rectangle containing two given rectangles
	/// </summary>
	/// <param name="rect1"></param>
	/// <returns></returns>
	static NAMESPACE::Rect MaxRect(IntPtr rect1, IntPtr rect2)
	{
		return *(NAMESPACE::Rect*)&cvMaxRect((CvRect*)rect1.ToPointer(), (CvRect*)rect2.ToPointer());
	}

	/// <summary>
	/// Finds coordinates of the box vertices
	/// </summary>
	/// <param name="box"></param>
	static void BoxPoints(NAMESPACE::Box2D box, IntPtr pt)
	{
		cvBoxPoints(*(CvBox2D*)&box, (CvPoint2D32f*)pt.ToPointer());
	}

	/// <summary>
	/// Initializes sequence header for a matrix (column or row vector) of points -
	/// a wrapper for cvMakeSeqHeaderForArray (it does not initialize bounding rectangle!!!)
	/// </summary>
	/// <param name="seq_kind"></param>
	/// <param name="mat"></param>
	/// <param name="contour_header"></param>
	/// <returns></returns>
	static IntPtr PointSeqFromMat(SeqFlag seq_kind, IntPtr mat, IntPtr contour_header, IntPtr block)
	{
		return IntPtr(cvPointSeqFromMat((int)seq_kind, (CvArr*)mat.ToPointer(), (CvContour*)contour_header.ToPointer(), (CvSeqBlock*)block.ToPointer()));
	}

	/// <summary>
	/// Checks whether the point is inside polygon, outside, on an edge (at a vertex).
	/// Returns positive, negative or zero value, correspondingly.
	/// Optionally, measures a signed distance between
	/// the point and the nearest polygon edge (measure_dist=1)
	/// </summary>
	/// <param name="contour"></param>
	/// <param name="pt"></param>
	/// <returns></returns>
	static double PointPolygonTest(IntPtr contour, NAMESPACE::Point2D32f pt, bool measure_dist)
	{
		return cvPointPolygonTest((CvArr*)contour.ToPointer(), *(CvPoint2D32f*)&pt, (int)measure_dist);
	}

	/// <summary>
	/// Creates new histogram
	/// </summary>
	/// <param name="dims"></param>
	/// <param name="sizes"></param>
	/// <param name="type"></param>
	/// <param name="ranges"></param>
	/// <returns></returns>
	static IntPtr CreateHist(int dims, IntPtr sizes, HistType type, IntPtr ranges, bool uniform)
	{
		return IntPtr(cvCreateHist(dims, (int*)sizes.ToPointer(), (int)type, (float**)ranges.ToPointer(), (int)uniform));
	}

	/// <summary>
	/// Creates new histogram
	/// </summary>
	/// <param name="dims"></param>
	/// <param name="sizes"></param>
	/// <param name="type"></param>
	/// <returns></returns>
	static IntPtr CreateHist(int dims, IntPtr sizes, HistType type, IntPtr ranges)
	{
		return IntPtr(cvCreateHist(dims, (int*)sizes.ToPointer(), (int)type, (float**)ranges.ToPointer()));
	}

	/// <summary>
	/// Creates new histogram
	/// </summary>
	/// <param name="dims"></param>
	/// <param name="sizes"></param>
	/// <returns></returns>
	static IntPtr CreateHist(int dims, IntPtr sizes, HistType type)
	{
		return IntPtr(cvCreateHist(dims, (int*)sizes.ToPointer(), (int)type));
	}

	/// <summary>
	/// Assignes histogram bin ranges
	/// </summary>
	/// <param name="hist"></param>
	/// <param name="ranges"></param>
	static void SetHistBinRanges(IntPtr hist, IntPtr ranges, bool uniform)
	{
		cvSetHistBinRanges((CvHistogram*)hist.ToPointer(), (float**)ranges.ToPointer(), (int)uniform);
	}

	/// <summary>
	/// Assignes histogram bin ranges
	/// </summary>
	/// <param name="hist"></param>
	static void SetHistBinRanges(IntPtr hist, IntPtr ranges)
	{
		cvSetHistBinRanges((CvHistogram*)hist.ToPointer(), (float**)ranges.ToPointer());
	}

	/// <summary>
	/// Creates histogram header for array
	/// </summary>
	/// <param name="dims"></param>
	/// <param name="sizes"></param>
	/// <param name="hist"></param>
	/// <param name="data"></param>
	/// <param name="ranges"></param>
	/// <returns></returns>
	static IntPtr MakeHistHeaderForArray(int dims, IntPtr sizes, IntPtr hist, IntPtr data, IntPtr ranges, bool uniform)
	{
		return IntPtr(cvMakeHistHeaderForArray(dims, (int*)sizes.ToPointer(), (CvHistogram*)hist.ToPointer(), (float*)data.ToPointer(), (float**)ranges.ToPointer(), (int)uniform));
	}

	/// <summary>
	/// Creates histogram header for array
	/// </summary>
	/// <param name="dims"></param>
	/// <param name="sizes"></param>
	/// <param name="hist"></param>
	/// <param name="data"></param>
	/// <returns></returns>
	static IntPtr MakeHistHeaderForArray(int dims, IntPtr sizes, IntPtr hist, IntPtr data, IntPtr ranges)
	{
		return IntPtr(cvMakeHistHeaderForArray(dims, (int*)sizes.ToPointer(), (CvHistogram*)hist.ToPointer(), (float*)data.ToPointer(), (float**)ranges.ToPointer()));
	}

	/// <summary>
	/// Creates histogram header for array
	/// </summary>
	/// <param name="dims"></param>
	/// <param name="sizes"></param>
	/// <param name="hist"></param>
	/// <returns></returns>
	static IntPtr MakeHistHeaderForArray(int dims, IntPtr sizes, IntPtr hist, IntPtr data)
	{
		return IntPtr(cvMakeHistHeaderForArray(dims, (int*)sizes.ToPointer(), (CvHistogram*)hist.ToPointer(), (float*)data.ToPointer()));
	}

	/// <summary>
	/// Releases histogram
	/// </summary>
	static void ReleaseHist(IntPtr hist)
	{
		cvReleaseHist((CvHistogram**)hist.ToPointer());
	}

	/// <summary>
	/// Clears all the histogram bins
	/// </summary>
	static void ClearHist(IntPtr hist)
	{
		cvClearHist((CvHistogram*)hist.ToPointer());
	}

	/// <summary>
	/// Finds indices and values of minimum and maximum histogram bins
	/// </summary>
	/// <param name="hist"></param>
	/// <param name="min_value"></param>
	/// <param name="max_value"></param>
	/// <param name="min_idx"></param>
	static void GetMinMaxHistValue(IntPtr hist, IntPtr min_value, IntPtr max_value, IntPtr min_idx, IntPtr max_idx)
	{
		cvGetMinMaxHistValue((CvHistogram*)hist.ToPointer(), (float*)min_value.ToPointer(), (float*)max_value.ToPointer(), (int*)min_idx.ToPointer(), (int*)max_idx.ToPointer());
	}

	/// <summary>
	/// Finds indices and values of minimum and maximum histogram bins
	/// </summary>
	/// <param name="hist"></param>
	/// <param name="min_value"></param>
	/// <param name="max_value"></param>
	static void GetMinMaxHistValue(IntPtr hist, IntPtr min_value, IntPtr max_value, IntPtr min_idx)
	{
		cvGetMinMaxHistValue((CvHistogram*)hist.ToPointer(), (float*)min_value.ToPointer(), (float*)max_value.ToPointer(), (int*)min_idx.ToPointer());
	}

	/// <summary>
	/// Finds indices and values of minimum and maximum histogram bins
	/// </summary>
	/// <param name="hist"></param>
	/// <param name="min_value"></param>
	static void GetMinMaxHistValue(IntPtr hist, IntPtr min_value, IntPtr max_value)
	{
		cvGetMinMaxHistValue((CvHistogram*)hist.ToPointer(), (float*)min_value.ToPointer(), (float*)max_value.ToPointer());
	}

	/// <summary>
	/// Normalizes histogram by dividing all bins by sum of the bins, multiplied by <factor>.
	/// After that sum of histogram bins is equal to <factor>
	/// </summary>
	/// <param name="hist"></param>
	static void NormalizeHist(IntPtr hist, double factor)
	{
		cvNormalizeHist((CvHistogram*)hist.ToPointer(), factor);
	}

	/// <summary>
	/// Clear all histogram bins that are below the threshold
	/// </summary>
	/// <param name="hist"></param>
	static void ThreshHist(IntPtr hist, double threshold)
	{
		cvThreshHist((CvHistogram*)hist.ToPointer(), threshold);
	}

	/// <summary>
	/// Compares two histogram
	/// </summary>
	/// <param name="hist1"></param>
	/// <param name="hist2"></param>
	/// <returns></returns>
	static double CompareHist(IntPtr hist1, IntPtr hist2, CompareHistMethod method)
	{
		return cvCompareHist((CvHistogram*)hist1.ToPointer(), (CvHistogram*)hist2.ToPointer(), (int)method);
	}

	/// <summary>
	/// Copies one histogram to another. Destination histogram is created if
	/// the destination pointer is NULL
	/// </summary>
	/// <param name="src"></param>
	static void CopyHist(IntPtr src, IntPtr dst)
	{
		cvCopyHist((CvHistogram*)src.ToPointer(), (CvHistogram**)dst.ToPointer());
	}

	/// <summary>
	/// Calculates bayesian probabilistic histograms
	/// (each or src and dst is an array of <number> histograms
	/// </summary>
	/// <param name="src"></param>
	/// <param name="number"></param>
	static void CalcBayesianProb(IntPtr src, int number, IntPtr dst)
	{
		cvCalcBayesianProb((CvHistogram**)src.ToPointer(), number, (CvHistogram**)dst.ToPointer());
	}

	/// <summary>
	/// Calculates array histogram
	/// </summary>
	/// <param name="arr"></param>
	/// <param name="hist"></param>
	/// <param name="accumulate"></param>
	static void CalcArrHist(IntPtr arr, IntPtr hist, bool accumulate, IntPtr mask)
	{
		cvCalcArrHist((CvArr**)arr.ToPointer(), (CvHistogram*)hist.ToPointer(), (int)accumulate, (CvArr*)mask.ToPointer());
	}

	/// <summary>
	/// Calculates array histogram
	/// </summary>
	/// <param name="arr"></param>
	/// <param name="hist"></param>
	static void CalcArrHist(IntPtr arr, IntPtr hist, bool accumulate)
	{
		cvCalcArrHist((CvArr**)arr.ToPointer(), (CvHistogram*)hist.ToPointer(), (int)accumulate);
	}

	/// <summary>
	/// Calculates array histogram
	/// </summary>
	/// <param name="arr"></param>
	static void CalcArrHist(IntPtr arr, IntPtr hist)
	{
		cvCalcArrHist((CvArr**)arr.ToPointer(), (CvHistogram*)hist.ToPointer());
	}

	/// <summary>
	/// Calculates back project
	/// </summary>
	/// <param name="image"></param>
	/// <param name="dst"></param>
	static void CalcArrBackProject(IntPtr image, IntPtr dst, IntPtr hist)
	{
		cvCalcArrBackProject((CvArr**)image.ToPointer(), (CvArr*)dst.ToPointer(), (CvHistogram*)hist.ToPointer());
	}

	/// <summary>
	/// Calculates back project
	/// </summary>
	/// <param name="image"></param>
	/// <param name="dst"></param>
	static void CalcBackProject(IntPtr image, IntPtr dst, IntPtr hist)
	{
		cvCalcBackProject((CvArr**)image.ToPointer(), (CvArr*)dst.ToPointer(), (CvHistogram*)hist.ToPointer());
	}

	/// <summary>
	/// Does some sort of template matching but compares histograms of
	/// template and each window location
	/// </summary>
	/// <param name="image"></param>
	/// <param name="dst"></param>
	/// <param name="range"></param>
	/// <param name="hist"></param>
	/// <param name="method"></param>
	static void CalcArrBackProjectPatch(IntPtr image, IntPtr dst, NAMESPACE::Size2D32s range, IntPtr hist, CompareHistMethod method, double factor)
	{
		cvCalcArrBackProjectPatch((CvArr**)image.ToPointer(), (CvArr*)dst.ToPointer(), *(CvSize*)&range, (CvHistogram*)hist.ToPointer(), (int)method, factor);
	}

	/// <summary>
	/// Does some sort of template matching but compares histograms of
	/// template and each window location
	/// </summary>
	/// <param name="image"></param>
	/// <param name="dst"></param>
	/// <param name="range"></param>
	/// <param name="hist"></param>
	/// <param name="method"></param>
	static void CalcBackProjectPatch(IntPtr image, IntPtr dst, NAMESPACE::Size2D32s range, IntPtr hist, CompareHistMethod method, double factor)
	{
		cvCalcBackProjectPatch((CvArr**)image.ToPointer(), (CvArr*)dst.ToPointer(), *(CvSize*)&range, (CvHistogram*)hist.ToPointer(), (int)method, factor);
	}

	/// <summary>
	/// calculates probabilistic density (divides one histogram by another)
	/// </summary>
	/// <param name="hist1"></param>
	/// <param name="hist2"></param>
	/// <param name="dst_hist"></param>
	static void CalcProbDensity(IntPtr hist1, IntPtr hist2, IntPtr dst_hist, double scale)
	{
		cvCalcProbDensity((CvHistogram*)hist1.ToPointer(), (CvHistogram*)hist2.ToPointer(), (CvHistogram*)dst_hist.ToPointer(), scale);
	}

	/// <summary>
	/// calculates probabilistic density (divides one histogram by another)
	/// </summary>
	/// <param name="hist1"></param>
	/// <param name="hist2"></param>
	static void CalcProbDensity(IntPtr hist1, IntPtr hist2, IntPtr dst_hist)
	{
		cvCalcProbDensity((CvHistogram*)hist1.ToPointer(), (CvHistogram*)hist2.ToPointer(), (CvHistogram*)dst_hist.ToPointer());
	}

	/// <summary>
	/// equalizes histogram of 8-bit single-channel image
	/// </summary>
	/// <param name="src"></param>
	static void EqualizeHist(IntPtr src, IntPtr dst)
	{
		cvEqualizeHist((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// Updates active contour in order to minimize its cummulative
	/// (internal and external) energy.
	/// </summary>
	/// <param name="image"></param>
	/// <param name="points"></param>
	/// <param name="length"></param>
	/// <param name="alpha"></param>
	/// <param name="beta"></param>
	/// <param name="gamma"></param>
	/// <param name="coeff_usage"></param>
	/// <param name="win"></param>
	/// <param name="criteria"></param>
	static void SnakeImage(IntPtr image, IntPtr points, int length, IntPtr alpha, IntPtr beta, IntPtr gamma, CoeffUsageType coeff_usage, NAMESPACE::Size2D32s win, NAMESPACE::TermCriteria criteria, bool calc_gradient)
	{
		cvSnakeImage((IplImage*)image.ToPointer(), (CvPoint*)points.ToPointer(), length, (float*)alpha.ToPointer(), (float*)beta.ToPointer(), (float*)gamma.ToPointer(), (int)coeff_usage, *(CvSize*)&win, *(CvTermCriteria*)&criteria, (int)calc_gradient);
	}

	/// <summary>
	/// Updates active contour in order to minimize its cummulative
	/// (internal and external) energy.
	/// </summary>
	/// <param name="image"></param>
	/// <param name="points"></param>
	/// <param name="length"></param>
	/// <param name="alpha"></param>
	/// <param name="beta"></param>
	/// <param name="gamma"></param>
	/// <param name="coeff_usage"></param>
	/// <param name="win"></param>
	static void SnakeImage(IntPtr image, IntPtr points, int length, IntPtr alpha, IntPtr beta, IntPtr gamma, CoeffUsageType coeff_usage, NAMESPACE::Size2D32s win, NAMESPACE::TermCriteria criteria)
	{
		cvSnakeImage((IplImage*)image.ToPointer(), (CvPoint*)points.ToPointer(), length, (float*)alpha.ToPointer(), (float*)beta.ToPointer(), (float*)gamma.ToPointer(), (int)coeff_usage, *(CvSize*)&win, *(CvTermCriteria*)&criteria);
	}

	/// <summary>
	/// Calculates the cooficients of the homography matrix
	/// </summary>
	/// <param name="line"></param>
	/// <param name="center"></param>
	/// <param name="intrinsic"></param>
	static void CalcImageHomography(IntPtr line, IntPtr center, IntPtr intrinsic, IntPtr homography)
	{
		cvCalcImageHomography((float*)line.ToPointer(), (CvPoint3D32f*)center.ToPointer(), (float*)intrinsic.ToPointer(), (float*)homography.ToPointer());
	}

	/// <summary>
	/// Applies distance transform to binary image
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="distance_type"></param>
	/// <param name="mask_size"></param>
	/// <param name="mask"></param>
	static void DistTransform(IntPtr src, IntPtr dst, DistanceType distance_type, DistanceTransformMask mask_size, IntPtr mask, IntPtr labels)
	{
		cvDistTransform((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)distance_type, (int)mask_size, (float*)mask.ToPointer(), (CvArr*)labels.ToPointer());
	}

	/// <summary>
	/// Applies distance transform to binary image
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="distance_type"></param>
	/// <param name="mask_size"></param>
	static void DistTransform(IntPtr src, IntPtr dst, DistanceType distance_type, DistanceTransformMask mask_size, IntPtr mask)
	{
		cvDistTransform((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)distance_type, (int)mask_size, (float*)mask.ToPointer());
	}

	/// <summary>
	/// Applies distance transform to binary image
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="distance_type"></param>
	static void DistTransform(IntPtr src, IntPtr dst, DistanceType distance_type, DistanceTransformMask mask_size)
	{
		cvDistTransform((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)distance_type, (int)mask_size);
	}

	/// <summary>
	/// Applies distance transform to binary image
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void DistTransform(IntPtr src, IntPtr dst, DistanceType distance_type)
	{
		cvDistTransform((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (int)distance_type);
	}

	/// <summary>
	/// Applies distance transform to binary image
	/// </summary>
	/// <param name="src"></param>
	static void DistTransform(IntPtr src, IntPtr dst)
	{
		cvDistTransform((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer());
	}

	/// <summary>
	/// Applies fixed-level threshold to grayscale image.
	/// This is a basic operation applied before retrieving contours
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="threshold"></param>
	/// <param name="max_value"></param>
	/// <returns></returns>
	static double Threshold(IntPtr src, IntPtr dst, double threshold, double max_value, ThreshTypeFlag threshold_type)
	{
		return cvThreshold((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), threshold, max_value, (int)threshold_type);
	}

	/// <summary>
	/// Applies adaptive threshold to grayscale image.
	/// The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and
	/// CV_ADAPTIVE_THRESH_GAUSSIAN_C are:
	/// neighborhood size (3, 5, 7 etc.),
	/// and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="max_value"></param>
	/// <param name="adaptive_method"></param>
	/// <param name="threshold_type"></param>
	/// <param name="block_size"></param>
	static void AdaptiveThreshold(IntPtr src, IntPtr dst, double max_value, AdaptiveThreshMethod adaptive_method, ThreshTypeFlag threshold_type, int block_size, double param1)
	{
		cvAdaptiveThreshold((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), max_value, (int)adaptive_method, (int)threshold_type, block_size, param1);
	}

	/// <summary>
	/// Applies adaptive threshold to grayscale image.
	/// The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and
	/// CV_ADAPTIVE_THRESH_GAUSSIAN_C are:
	/// neighborhood size (3, 5, 7 etc.),
	/// and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="max_value"></param>
	/// <param name="adaptive_method"></param>
	/// <param name="threshold_type"></param>
	static void AdaptiveThreshold(IntPtr src, IntPtr dst, double max_value, AdaptiveThreshMethod adaptive_method, ThreshTypeFlag threshold_type, int block_size)
	{
		cvAdaptiveThreshold((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), max_value, (int)adaptive_method, (int)threshold_type, block_size);
	}

	/// <summary>
	/// Applies adaptive threshold to grayscale image.
	/// The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and
	/// CV_ADAPTIVE_THRESH_GAUSSIAN_C are:
	/// neighborhood size (3, 5, 7 etc.),
	/// and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="max_value"></param>
	/// <param name="adaptive_method"></param>
	static void AdaptiveThreshold(IntPtr src, IntPtr dst, double max_value, AdaptiveThreshMethod adaptive_method, ThreshTypeFlag threshold_type)
	{
		cvAdaptiveThreshold((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), max_value, (int)adaptive_method, (int)threshold_type);
	}

	/// <summary>
	/// Applies adaptive threshold to grayscale image.
	/// The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and
	/// CV_ADAPTIVE_THRESH_GAUSSIAN_C are:
	/// neighborhood size (3, 5, 7 etc.),
	/// and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="max_value"></param>
	static void AdaptiveThreshold(IntPtr src, IntPtr dst, double max_value, AdaptiveThreshMethod adaptive_method)
	{
		cvAdaptiveThreshold((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), max_value, (int)adaptive_method);
	}

	/// <summary>
	/// Applies adaptive threshold to grayscale image.
	/// The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and
	/// CV_ADAPTIVE_THRESH_GAUSSIAN_C are:
	/// neighborhood size (3, 5, 7 etc.),
	/// and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...)
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	static void AdaptiveThreshold(IntPtr src, IntPtr dst, double max_value)
	{
		cvAdaptiveThreshold((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), max_value);
	}

	/// <summary>
	/// Fills the connected component until the color difference gets large enough
	/// </summary>
	/// <param name="image"></param>
	/// <param name="seed_point"></param>
	/// <param name="new_val"></param>
	/// <param name="lo_diff"></param>
	/// <param name="up_diff"></param>
	/// <param name="comp"></param>
	/// <param name="flags"></param>
	static void FloodFill(IntPtr image, NAMESPACE::Point2D32s seed_point, NAMESPACE::Scalar new_val, NAMESPACE::Scalar lo_diff, NAMESPACE::Scalar up_diff, IntPtr comp, FloodFillFlag flags, IntPtr mask)
	{
		cvFloodFill((CvArr*)image.ToPointer(), *(CvPoint*)&seed_point, *(CvScalar*)&new_val, *(CvScalar*)&lo_diff, *(CvScalar*)&up_diff, (CvConnectedComp*)comp.ToPointer(), (int)flags, (CvArr*)mask.ToPointer());
	}

	/// <summary>
	/// Fills the connected component until the color difference gets large enough
	/// </summary>
	/// <param name="image"></param>
	/// <param name="seed_point"></param>
	/// <param name="new_val"></param>
	/// <param name="lo_diff"></param>
	/// <param name="up_diff"></param>
	/// <param name="comp"></param>
	static void FloodFill(IntPtr image, NAMESPACE::Point2D32s seed_point, NAMESPACE::Scalar new_val, NAMESPACE::Scalar lo_diff, NAMESPACE::Scalar up_diff, IntPtr comp, FloodFillFlag flags)
	{
		cvFloodFill((CvArr*)image.ToPointer(), *(CvPoint*)&seed_point, *(CvScalar*)&new_val, *(CvScalar*)&lo_diff, *(CvScalar*)&up_diff, (CvConnectedComp*)comp.ToPointer(), (int)flags);
	}

	/// <summary>
	/// Fills the connected component until the color difference gets large enough
	/// </summary>
	/// <param name="image"></param>
	/// <param name="seed_point"></param>
	/// <param name="new_val"></param>
	/// <param name="lo_diff"></param>
	/// <param name="up_diff"></param>
	static void FloodFill(IntPtr image, NAMESPACE::Point2D32s seed_point, NAMESPACE::Scalar new_val, NAMESPACE::Scalar lo_diff, NAMESPACE::Scalar up_diff, IntPtr comp)
	{
		cvFloodFill((CvArr*)image.ToPointer(), *(CvPoint*)&seed_point, *(CvScalar*)&new_val, *(CvScalar*)&lo_diff, *(CvScalar*)&up_diff, (CvConnectedComp*)comp.ToPointer());
	}

	/// <summary>
	/// Fills the connected component until the color difference gets large enough
	/// </summary>
	/// <param name="image"></param>
	/// <param name="seed_point"></param>
	/// <param name="new_val"></param>
	/// <param name="lo_diff"></param>
	static void FloodFill(IntPtr image, NAMESPACE::Point2D32s seed_point, NAMESPACE::Scalar new_val, NAMESPACE::Scalar lo_diff, NAMESPACE::Scalar up_diff)
	{
		cvFloodFill((CvArr*)image.ToPointer(), *(CvPoint*)&seed_point, *(CvScalar*)&new_val, *(CvScalar*)&lo_diff, *(CvScalar*)&up_diff);
	}

	/// <summary>
	/// Fills the connected component until the color difference gets large enough
	/// </summary>
	/// <param name="image"></param>
	/// <param name="seed_point"></param>
	/// <param name="new_val"></param>
	static void FloodFill(IntPtr image, NAMESPACE::Point2D32s seed_point, NAMESPACE::Scalar new_val, NAMESPACE::Scalar lo_diff)
	{
		cvFloodFill((CvArr*)image.ToPointer(), *(CvPoint*)&seed_point, *(CvScalar*)&new_val, *(CvScalar*)&lo_diff);
	}

	/// <summary>
	/// Fills the connected component until the color difference gets large enough
	/// </summary>
	/// <param name="image"></param>
	/// <param name="seed_point"></param>
	static void FloodFill(IntPtr image, NAMESPACE::Point2D32s seed_point, NAMESPACE::Scalar new_val)
	{
		cvFloodFill((CvArr*)image.ToPointer(), *(CvPoint*)&seed_point, *(CvScalar*)&new_val);
	}

	/// <summary>
	/// Runs canny edge detector
	/// </summary>
	/// <param name="image"></param>
	/// <param name="edges"></param>
	/// <param name="threshold1"></param>
	/// <param name="threshold2"></param>
	static void Canny(IntPtr image, IntPtr edges, double threshold1, double threshold2, ApertureSize aperture_size)
	{
		cvCanny((CvArr*)image.ToPointer(), (CvArr*)edges.ToPointer(), threshold1, threshold2, (int)aperture_size);
	}

	/// <summary>
	/// Runs canny edge detector
	/// </summary>
	/// <param name="image"></param>
	/// <param name="edges"></param>
	/// <param name="threshold1"></param>
	static void Canny(IntPtr image, IntPtr edges, double threshold1, double threshold2)
	{
		cvCanny((CvArr*)image.ToPointer(), (CvArr*)edges.ToPointer(), threshold1, threshold2);
	}

	/// <summary>
	/// Calculates constraint image for corner detection
	/// Dx^2 * Dyy + Dxx * Dy^2 - 2 * Dx * Dy * Dxy.
	/// Applying threshold to the result gives coordinates of corners
	/// </summary>
	/// <param name="image"></param>
	/// <param name="corners"></param>
	static void PreCornerDetect(IntPtr image, IntPtr corners, ApertureSize aperture_size)
	{
		cvPreCornerDetect((CvArr*)image.ToPointer(), (CvArr*)corners.ToPointer(), (int)aperture_size);
	}

	/// <summary>
	/// Calculates constraint image for corner detection
	/// Dx^2 * Dyy + Dxx * Dy^2 - 2 * Dx * Dy * Dxy.
	/// Applying threshold to the result gives coordinates of corners
	/// </summary>
	/// <param name="image"></param>
	static void PreCornerDetect(IntPtr image, IntPtr corners)
	{
		cvPreCornerDetect((CvArr*)image.ToPointer(), (CvArr*)corners.ToPointer());
	}

	/// <summary>
	/// Calculates eigen values and vectors of 2x2
	/// gradient covariation matrix at every image pixel
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eigenvv"></param>
	/// <param name="block_size"></param>
	static void CornerEigenValsAndVecs(IntPtr image, IntPtr eigenvv, int block_size, ApertureSize aperture_size)
	{
		cvCornerEigenValsAndVecs((CvArr*)image.ToPointer(), (CvArr*)eigenvv.ToPointer(), block_size, (int)aperture_size);
	}

	/// <summary>
	/// Calculates eigen values and vectors of 2x2
	/// gradient covariation matrix at every image pixel
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eigenvv"></param>
	static void CornerEigenValsAndVecs(IntPtr image, IntPtr eigenvv, int block_size)
	{
		cvCornerEigenValsAndVecs((CvArr*)image.ToPointer(), (CvArr*)eigenvv.ToPointer(), block_size);
	}

	/// <summary>
	/// Calculates minimal eigenvalue for 2x2 gradient covariation matrix at
	/// every image pixel
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eigenval"></param>
	/// <param name="block_size"></param>
	static void CornerMinEigenVal(IntPtr image, IntPtr eigenval, int block_size, ApertureSize aperture_size)
	{
		cvCornerMinEigenVal((CvArr*)image.ToPointer(), (CvArr*)eigenval.ToPointer(), block_size, (int)aperture_size);
	}

	/// <summary>
	/// Calculates minimal eigenvalue for 2x2 gradient covariation matrix at
	/// every image pixel
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eigenval"></param>
	static void CornerMinEigenVal(IntPtr image, IntPtr eigenval, int block_size)
	{
		cvCornerMinEigenVal((CvArr*)image.ToPointer(), (CvArr*)eigenval.ToPointer(), block_size);
	}

	/// <summary>
	/// Harris corner detector:
	/// Calculates det(M) - k*(trace(M)^2), where M is 2x2 gradient covariation matrix for each pixel
	/// </summary>
	/// <param name="image"></param>
	/// <param name="harris_responce"></param>
	/// <param name="block_size"></param>
	/// <param name="aperture_size"></param>
	static void CornerHarris(IntPtr image, IntPtr harris_responce, int block_size, ApertureSize aperture_size, double k)
	{
		cvCornerHarris((CvArr*)image.ToPointer(), (CvArr*)harris_responce.ToPointer(), block_size, (int)aperture_size, k);
	}

	/// <summary>
	/// Harris corner detector:
	/// Calculates det(M) - k*(trace(M)^2), where M is 2x2 gradient covariation matrix for each pixel
	/// </summary>
	/// <param name="image"></param>
	/// <param name="harris_responce"></param>
	/// <param name="block_size"></param>
	static void CornerHarris(IntPtr image, IntPtr harris_responce, int block_size, ApertureSize aperture_size)
	{
		cvCornerHarris((CvArr*)image.ToPointer(), (CvArr*)harris_responce.ToPointer(), block_size, (int)aperture_size);
	}

	/// <summary>
	/// Harris corner detector:
	/// Calculates det(M) - k*(trace(M)^2), where M is 2x2 gradient covariation matrix for each pixel
	/// </summary>
	/// <param name="image"></param>
	/// <param name="harris_responce"></param>
	static void CornerHarris(IntPtr image, IntPtr harris_responce, int block_size)
	{
		cvCornerHarris((CvArr*)image.ToPointer(), (CvArr*)harris_responce.ToPointer(), block_size);
	}

	/// <summary>
	/// Adjust corner position using some sort of gradient search
	/// </summary>
	/// <param name="image"></param>
	/// <param name="corners"></param>
	/// <param name="count"></param>
	/// <param name="win"></param>
	/// <param name="zero_zone"></param>
	static void FindCornerSubPix(IntPtr image, IntPtr corners, int count, NAMESPACE::Size2D32s win, NAMESPACE::Size2D32s zero_zone, NAMESPACE::TermCriteria criteria)
	{
		cvFindCornerSubPix((CvArr*)image.ToPointer(), (CvPoint2D32f*)corners.ToPointer(), count, *(CvSize*)&win, *(CvSize*)&zero_zone, *(CvTermCriteria*)&criteria);
	}

	/// <summary>
	/// Finds a sparse set of points within the selected region
	/// that seem to be easy to track
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eig_image"></param>
	/// <param name="temp_image"></param>
	/// <param name="corners"></param>
	/// <param name="corner_count"></param>
	/// <param name="quality_level"></param>
	/// <param name="min_distance"></param>
	/// <param name="mask"></param>
	/// <param name="block_size"></param>
	/// <param name="use_harris"></param>
	static void GoodFeaturesToTrack(IntPtr image, IntPtr eig_image, IntPtr temp_image, IntPtr corners, IntPtr corner_count, double quality_level, double min_distance, IntPtr mask, int block_size, bool use_harris, double k)
	{
		cvGoodFeaturesToTrack((CvArr*)image.ToPointer(), (CvArr*)eig_image.ToPointer(), (CvArr*)temp_image.ToPointer(), (CvPoint2D32f*)corners.ToPointer(), (int*)corner_count.ToPointer(), quality_level, min_distance, (CvArr*)mask.ToPointer(), block_size, (int)use_harris, k);
	}

	/// <summary>
	/// Finds a sparse set of points within the selected region
	/// that seem to be easy to track
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eig_image"></param>
	/// <param name="temp_image"></param>
	/// <param name="corners"></param>
	/// <param name="corner_count"></param>
	/// <param name="quality_level"></param>
	/// <param name="min_distance"></param>
	/// <param name="mask"></param>
	/// <param name="block_size"></param>
	static void GoodFeaturesToTrack(IntPtr image, IntPtr eig_image, IntPtr temp_image, IntPtr corners, IntPtr corner_count, double quality_level, double min_distance, IntPtr mask, int block_size, bool use_harris)
	{
		cvGoodFeaturesToTrack((CvArr*)image.ToPointer(), (CvArr*)eig_image.ToPointer(), (CvArr*)temp_image.ToPointer(), (CvPoint2D32f*)corners.ToPointer(), (int*)corner_count.ToPointer(), quality_level, min_distance, (CvArr*)mask.ToPointer(), block_size, (int)use_harris);
	}

	/// <summary>
	/// Finds a sparse set of points within the selected region
	/// that seem to be easy to track
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eig_image"></param>
	/// <param name="temp_image"></param>
	/// <param name="corners"></param>
	/// <param name="corner_count"></param>
	/// <param name="quality_level"></param>
	/// <param name="min_distance"></param>
	/// <param name="mask"></param>
	static void GoodFeaturesToTrack(IntPtr image, IntPtr eig_image, IntPtr temp_image, IntPtr corners, IntPtr corner_count, double quality_level, double min_distance, IntPtr mask, int block_size)
	{
		cvGoodFeaturesToTrack((CvArr*)image.ToPointer(), (CvArr*)eig_image.ToPointer(), (CvArr*)temp_image.ToPointer(), (CvPoint2D32f*)corners.ToPointer(), (int*)corner_count.ToPointer(), quality_level, min_distance, (CvArr*)mask.ToPointer(), block_size);
	}

	/// <summary>
	/// Finds a sparse set of points within the selected region
	/// that seem to be easy to track
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eig_image"></param>
	/// <param name="temp_image"></param>
	/// <param name="corners"></param>
	/// <param name="corner_count"></param>
	/// <param name="quality_level"></param>
	/// <param name="min_distance"></param>
	static void GoodFeaturesToTrack(IntPtr image, IntPtr eig_image, IntPtr temp_image, IntPtr corners, IntPtr corner_count, double quality_level, double min_distance, IntPtr mask)
	{
		cvGoodFeaturesToTrack((CvArr*)image.ToPointer(), (CvArr*)eig_image.ToPointer(), (CvArr*)temp_image.ToPointer(), (CvPoint2D32f*)corners.ToPointer(), (int*)corner_count.ToPointer(), quality_level, min_distance, (CvArr*)mask.ToPointer());
	}

	/// <summary>
	/// Finds a sparse set of points within the selected region
	/// that seem to be easy to track
	/// </summary>
	/// <param name="image"></param>
	/// <param name="eig_image"></param>
	/// <param name="temp_image"></param>
	/// <param name="corners"></param>
	/// <param name="corner_count"></param>
	/// <param name="quality_level"></param>
	static void GoodFeaturesToTrack(IntPtr image, IntPtr eig_image, IntPtr temp_image, IntPtr corners, IntPtr corner_count, double quality_level, double min_distance)
	{
		cvGoodFeaturesToTrack((CvArr*)image.ToPointer(), (CvArr*)eig_image.ToPointer(), (CvArr*)temp_image.ToPointer(), (CvPoint2D32f*)corners.ToPointer(), (int*)corner_count.ToPointer(), quality_level, min_distance);
	}

	/// <summary>
	/// Finds lines on binary image using one of several methods.
	/// line_storage is either memory storage or 1 x <max number of lines> CvMat, its
	/// number of columns is changed by the function.
	/// method is one of CV_HOUGH_*;
	/// rho, theta and threshold are used for each of those methods;
	/// param1 ~ line length, param2 ~ line gap - for probabilistic,
	/// param1 ~ srn, param2 ~ stn - for multi-scale
	/// </summary>
	/// <param name="image"></param>
	/// <param name="line_storage"></param>
	/// <param name="method"></param>
	/// <param name="rho"></param>
	/// <param name="theta"></param>
	/// <param name="threshold"></param>
	/// <param name="param1"></param>
	/// <returns></returns>
	static IntPtr HoughLines2(IntPtr image, IntPtr line_storage, HoughMethod method, double rho, double theta, int threshold, double param1, double param2)
	{
		return IntPtr(cvHoughLines2((CvArr*)image.ToPointer(), (void*)line_storage.ToPointer(), (int)method, rho, theta, threshold, param1, param2));
	}

	/// <summary>
	/// Finds lines on binary image using one of several methods.
	/// line_storage is either memory storage or 1 x <max number of lines> CvMat, its
	/// number of columns is changed by the function.
	/// method is one of CV_HOUGH_*;
	/// rho, theta and threshold are used for each of those methods;
	/// param1 ~ line length, param2 ~ line gap - for probabilistic,
	/// param1 ~ srn, param2 ~ stn - for multi-scale
	/// </summary>
	/// <param name="image"></param>
	/// <param name="line_storage"></param>
	/// <param name="method"></param>
	/// <param name="rho"></param>
	/// <param name="theta"></param>
	/// <param name="threshold"></param>
	/// <returns></returns>
	static IntPtr HoughLines2(IntPtr image, IntPtr line_storage, HoughMethod method, double rho, double theta, int threshold, double param1)
	{
		return IntPtr(cvHoughLines2((CvArr*)image.ToPointer(), (void*)line_storage.ToPointer(), (int)method, rho, theta, threshold, param1));
	}

	/// <summary>
	/// Finds lines on binary image using one of several methods.
	/// line_storage is either memory storage or 1 x <max number of lines> CvMat, its
	/// number of columns is changed by the function.
	/// method is one of CV_HOUGH_*;
	/// rho, theta and threshold are used for each of those methods;
	/// param1 ~ line length, param2 ~ line gap - for probabilistic,
	/// param1 ~ srn, param2 ~ stn - for multi-scale
	/// </summary>
	/// <param name="image"></param>
	/// <param name="line_storage"></param>
	/// <param name="method"></param>
	/// <param name="rho"></param>
	/// <param name="theta"></param>
	/// <returns></returns>
	static IntPtr HoughLines2(IntPtr image, IntPtr line_storage, HoughMethod method, double rho, double theta, int threshold)
	{
		return IntPtr(cvHoughLines2((CvArr*)image.ToPointer(), (void*)line_storage.ToPointer(), (int)method, rho, theta, threshold));
	}

	/// <summary>
	/// Finds circles in the image
	/// </summary>
	/// <param name="image"></param>
	/// <param name="circle_storage"></param>
	/// <param name="method"></param>
	/// <param name="dp"></param>
	/// <param name="min_dist"></param>
	/// <param name="param1"></param>
	/// <param name="param2"></param>
	/// <param name="min_radius"></param>
	/// <returns></returns>
	static IntPtr HoughCircles(IntPtr image, IntPtr circle_storage, HoughMethod method, double dp, double min_dist, double param1, double param2, int min_radius, int max_radius)
	{
		return IntPtr(cvHoughCircles((CvArr*)image.ToPointer(), (void*)circle_storage.ToPointer(), (int)method, dp, min_dist, param1, param2, min_radius, max_radius));
	}

	/// <summary>
	/// Finds circles in the image
	/// </summary>
	/// <param name="image"></param>
	/// <param name="circle_storage"></param>
	/// <param name="method"></param>
	/// <param name="dp"></param>
	/// <param name="min_dist"></param>
	/// <param name="param1"></param>
	/// <param name="param2"></param>
	/// <returns></returns>
	static IntPtr HoughCircles(IntPtr image, IntPtr circle_storage, HoughMethod method, double dp, double min_dist, double param1, double param2, int min_radius)
	{
		return IntPtr(cvHoughCircles((CvArr*)image.ToPointer(), (void*)circle_storage.ToPointer(), (int)method, dp, min_dist, param1, param2, min_radius));
	}

	/// <summary>
	/// Finds circles in the image
	/// </summary>
	/// <param name="image"></param>
	/// <param name="circle_storage"></param>
	/// <param name="method"></param>
	/// <param name="dp"></param>
	/// <param name="min_dist"></param>
	/// <param name="param1"></param>
	/// <returns></returns>
	static IntPtr HoughCircles(IntPtr image, IntPtr circle_storage, HoughMethod method, double dp, double min_dist, double param1, double param2)
	{
		return IntPtr(cvHoughCircles((CvArr*)image.ToPointer(), (void*)circle_storage.ToPointer(), (int)method, dp, min_dist, param1, param2));
	}

	/// <summary>
	/// Finds circles in the image
	/// </summary>
	/// <param name="image"></param>
	/// <param name="circle_storage"></param>
	/// <param name="method"></param>
	/// <param name="dp"></param>
	/// <param name="min_dist"></param>
	/// <returns></returns>
	static IntPtr HoughCircles(IntPtr image, IntPtr circle_storage, HoughMethod method, double dp, double min_dist, double param1)
	{
		return IntPtr(cvHoughCircles((CvArr*)image.ToPointer(), (void*)circle_storage.ToPointer(), (int)method, dp, min_dist, param1));
	}

	/// <summary>
	/// Finds circles in the image
	/// </summary>
	/// <param name="image"></param>
	/// <param name="circle_storage"></param>
	/// <param name="method"></param>
	/// <param name="dp"></param>
	/// <returns></returns>
	static IntPtr HoughCircles(IntPtr image, IntPtr circle_storage, HoughMethod method, double dp, double min_dist)
	{
		return IntPtr(cvHoughCircles((CvArr*)image.ToPointer(), (void*)circle_storage.ToPointer(), (int)method, dp, min_dist));
	}

	/// <summary>
	/// Fits a line into set of 2d or 3d points in a robust way (M-estimator technique)
	/// </summary>
	/// <param name="points"></param>
	/// <param name="dist_type"></param>
	/// <param name="param"></param>
	/// <param name="reps"></param>
	/// <param name="aeps"></param>
	static void FitLine(IntPtr points, DistanceType dist_type, double param, double reps, double aeps, IntPtr line)
	{
		cvFitLine((CvArr*)points.ToPointer(), (int)dist_type, param, reps, aeps, (float*)line.ToPointer());
	}

	/// <summary>
	/// Constructs kd-tree from set of feature descriptors
	/// </summary>
	/// <returns></returns>
	static IntPtr CreateKDTree(IntPtr desc)
	{
		return IntPtr(cvCreateKDTree((CvMat*)desc.ToPointer()));
	}

	/// <summary>
	/// Constructs spill-tree from set of feature descriptors
	/// </summary>
	/// <param name="raw_data"></param>
	/// <param name="naive"></param>
	/// <param name="rho"></param>
	/// <returns></returns>
	static IntPtr CreateSpillTree(IntPtr raw_data, int naive, double rho, double tau)
	{
		return IntPtr(cvCreateSpillTree((CvMat*)raw_data.ToPointer(), naive, rho, tau));
	}

	/// <summary>
	/// Constructs spill-tree from set of feature descriptors
	/// </summary>
	/// <param name="raw_data"></param>
	/// <param name="naive"></param>
	/// <returns></returns>
	static IntPtr CreateSpillTree(IntPtr raw_data, int naive, double rho)
	{
		return IntPtr(cvCreateSpillTree((CvMat*)raw_data.ToPointer(), naive, rho));
	}

	/// <summary>
	/// Constructs spill-tree from set of feature descriptors
	/// </summary>
	/// <param name="raw_data"></param>
	/// <returns></returns>
	static IntPtr CreateSpillTree(IntPtr raw_data, int naive)
	{
		return IntPtr(cvCreateSpillTree((CvMat*)raw_data.ToPointer(), naive));
	}

	/// <summary>
	/// Constructs spill-tree from set of feature descriptors
	/// </summary>
	/// <returns></returns>
	static IntPtr CreateSpillTree(IntPtr raw_data)
	{
		return IntPtr(cvCreateSpillTree((CvMat*)raw_data.ToPointer()));
	}

	/// <summary>
	/// Release feature tree
	/// </summary>
	static void ReleaseFeatureTree(IntPtr tr)
	{
		cvReleaseFeatureTree((CvFeatureTree*)tr.ToPointer());
	}

	/// <summary>
	/// Searches feature tree for k nearest neighbors of given reference points,
	/// searching (in case of kd-tree/bbf) at most emax leaves.
	/// </summary>
	/// <param name="tr"></param>
	/// <param name="query_points"></param>
	/// <param name="indices"></param>
	/// <param name="dist"></param>
	/// <param name="k"></param>
	static void FindFeatures(IntPtr tr, IntPtr query_points, IntPtr indices, IntPtr dist, int k, int emax)
	{
		cvFindFeatures((CvFeatureTree*)tr.ToPointer(), (CvMat*)query_points.ToPointer(), (CvMat*)indices.ToPointer(), (CvMat*)dist.ToPointer(), k, emax);
	}

	/// <summary>
	/// Searches feature tree for k nearest neighbors of given reference points,
	/// searching (in case of kd-tree/bbf) at most emax leaves.
	/// </summary>
	/// <param name="tr"></param>
	/// <param name="query_points"></param>
	/// <param name="indices"></param>
	/// <param name="dist"></param>
	static void FindFeatures(IntPtr tr, IntPtr query_points, IntPtr indices, IntPtr dist, int k)
	{
		cvFindFeatures((CvFeatureTree*)tr.ToPointer(), (CvMat*)query_points.ToPointer(), (CvMat*)indices.ToPointer(), (CvMat*)dist.ToPointer(), k);
	}

	/// <summary>
	/// Search feature tree for all points that are inlier to given rect region.
	/// Only implemented for kd trees
	/// </summary>
	/// <param name="tr"></param>
	/// <param name="bounds_min"></param>
	/// <param name="bounds_max"></param>
	/// <returns></returns>
	static int FindFeaturesBoxed(IntPtr tr, IntPtr bounds_min, IntPtr bounds_max, IntPtr out_indices)
	{
		return cvFindFeaturesBoxed((CvFeatureTree*)tr.ToPointer(), (CvMat*)bounds_min.ToPointer(), (CvMat*)bounds_max.ToPointer(), (CvMat*)out_indices.ToPointer());
	}

	/// <summary>
	/// Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of
	/// given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions.
	/// </summary>
	/// <param name="ops"></param>
	/// <param name="d"></param>
	/// <param name="L"></param>
	/// <param name="k"></param>
	/// <param name="type"></param>
	/// <param name="r"></param>
	/// <returns></returns>
	static IntPtr CreateLSH(IntPtr ops, int d, int L, int k, MatFlag type, double r, int64 seed)
	{
		return IntPtr(cvCreateLSH((CvLSHOperations*)ops.ToPointer(), d, L, k, (int)type, r, seed));
	}

	/// <summary>
	/// Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of
	/// given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions.
	/// </summary>
	/// <param name="ops"></param>
	/// <param name="d"></param>
	/// <param name="L"></param>
	/// <param name="k"></param>
	/// <param name="type"></param>
	/// <returns></returns>
	static IntPtr CreateLSH(IntPtr ops, int d, int L, int k, MatFlag type, double r)
	{
		return IntPtr(cvCreateLSH((CvLSHOperations*)ops.ToPointer(), d, L, k, (int)type, r));
	}

	/// <summary>
	/// Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of
	/// given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions.
	/// </summary>
	/// <param name="ops"></param>
	/// <param name="d"></param>
	/// <param name="L"></param>
	/// <param name="k"></param>
	/// <returns></returns>
	static IntPtr CreateLSH(IntPtr ops, int d, int L, int k, MatFlag type)
	{
		return IntPtr(cvCreateLSH((CvLSHOperations*)ops.ToPointer(), d, L, k, (int)type));
	}

	/// <summary>
	/// Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of
	/// given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions.
	/// </summary>
	/// <param name="ops"></param>
	/// <param name="d"></param>
	/// <param name="L"></param>
	/// <returns></returns>
	static IntPtr CreateLSH(IntPtr ops, int d, int L, int k)
	{
		return IntPtr(cvCreateLSH((CvLSHOperations*)ops.ToPointer(), d, L, k));
	}

	/// <summary>
	/// Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of
	/// given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions.
	/// </summary>
	/// <param name="ops"></param>
	/// <param name="d"></param>
	/// <returns></returns>
	static IntPtr CreateLSH(IntPtr ops, int d, int L)
	{
		return IntPtr(cvCreateLSH((CvLSHOperations*)ops.ToPointer(), d, L));
	}

	/// <summary>
	/// Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of
	/// given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions.
	/// </summary>
	/// <param name="ops"></param>
	/// <returns></returns>
	static IntPtr CreateLSH(IntPtr ops, int d)
	{
		return IntPtr(cvCreateLSH((CvLSHOperations*)ops.ToPointer(), d));
	}

	/// <summary>
	/// Construct in-memory LSH table, with n bins.
	/// </summary>
	/// <param name="d"></param>
	/// <param name="n"></param>
	/// <param name="L"></param>
	/// <param name="k"></param>
	/// <param name="type"></param>
	/// <param name="r"></param>
	/// <returns></returns>
	static IntPtr CreateMemoryLSH(int d, int n, int L, int k, MatFlag type, double r, int64 seed)
	{
		return IntPtr(cvCreateMemoryLSH(d, n, L, k, (int)type, r, seed));
	}

	/// <summary>
	/// Construct in-memory LSH table, with n bins.
	/// </summary>
	/// <param name="d"></param>
	/// <param name="n"></param>
	/// <param name="L"></param>
	/// <param name="k"></param>
	/// <param name="type"></param>
	/// <returns></returns>
	static IntPtr CreateMemoryLSH(int d, int n, int L, int k, MatFlag type, double r)
	{
		return IntPtr(cvCreateMemoryLSH(d, n, L, k, (int)type, r));
	}

	/// <summary>
	/// Construct in-memory LSH table, with n bins.
	/// </summary>
	/// <param name="d"></param>
	/// <param name="n"></param>
	/// <param name="L"></param>
	/// <param name="k"></param>
	/// <returns></returns>
	static IntPtr CreateMemoryLSH(int d, int n, int L, int k, MatFlag type)
	{
		return IntPtr(cvCreateMemoryLSH(d, n, L, k, (int)type));
	}

	/// <summary>
	/// Construct in-memory LSH table, with n bins.
	/// </summary>
	/// <param name="d"></param>
	/// <param name="n"></param>
	/// <param name="L"></param>
	/// <returns></returns>
	static IntPtr CreateMemoryLSH(int d, int n, int L, int k)
	{
		return IntPtr(cvCreateMemoryLSH(d, n, L, k));
	}

	/// <summary>
	/// Construct in-memory LSH table, with n bins.
	/// </summary>
	/// <param name="d"></param>
	/// <param name="n"></param>
	/// <returns></returns>
	static IntPtr CreateMemoryLSH(int d, int n, int L)
	{
		return IntPtr(cvCreateMemoryLSH(d, n, L));
	}

	/// <summary>
	/// Construct in-memory LSH table, with n bins.
	/// </summary>
	/// <param name="d"></param>
	/// <returns></returns>
	static IntPtr CreateMemoryLSH(int d, int n)
	{
		return IntPtr(cvCreateMemoryLSH(d, n));
	}

	/// <summary>
	/// Free the given LSH structure.
	/// </summary>
	static void ReleaseLSH(IntPtr lsh)
	{
		cvReleaseLSH((CvLSH**)lsh.ToPointer());
	}

	/// <summary>
	/// Return the number of vectors in the LSH.
	/// </summary>
	/// <returns></returns>
	static unsigned int HSize(IntPtr lsh)
	{
		return LSHSize((CvLSH*)lsh.ToPointer());
	}

	/// <summary>
	/// Add vectors to the LSH structure, optionally returning indices.
	/// </summary>
	/// <param name="lsh"></param>
	/// <param name="data"></param>
	static void LSHAdd(IntPtr lsh, IntPtr data, IntPtr indices)
	{
		cvLSHAdd((CvLSH*)lsh.ToPointer(), (CvMat*)data.ToPointer(), (CvMat*)indices.ToPointer());
	}

	/// <summary>
	/// Add vectors to the LSH structure, optionally returning indices.
	/// </summary>
	/// <param name="lsh"></param>
	static void LSHAdd(IntPtr lsh, IntPtr data)
	{
		cvLSHAdd((CvLSH*)lsh.ToPointer(), (CvMat*)data.ToPointer());
	}

	/// <summary>
	/// Remove vectors from LSH, as addressed by given indices.
	/// </summary>
	/// <param name="lsh"></param>
	static void LSHRemove(IntPtr lsh, IntPtr indices)
	{
		cvLSHRemove((CvLSH*)lsh.ToPointer(), (CvMat*)indices.ToPointer());
	}

	/// <summary>
	/// Query the LSH n times for at most k nearest points; data is n x d,
	/// indices and dist are n x k. At most emax stored points will be accessed.
	/// </summary>
	/// <param name="lsh"></param>
	/// <param name="query_points"></param>
	/// <param name="indices"></param>
	/// <param name="dist"></param>
	/// <param name="k"></param>
	static void LSHQuery(IntPtr lsh, IntPtr query_points, IntPtr indices, IntPtr dist, int k, int emax)
	{
		cvLSHQuery((CvLSH*)lsh.ToPointer(), (CvMat*)query_points.ToPointer(), (CvMat*)indices.ToPointer(), (CvMat*)dist.ToPointer(), k, emax);
	}

	/// <summary>
	/// </summary>
	/// <param name="hessianThreshold"></param>
	/// <returns></returns>
	static NAMESPACE::SURFParams SURFParams(double hessianThreshold, int extended)
	{
		return *(NAMESPACE::SURFParams*)&cvSURFParams(hessianThreshold, extended);
	}

	/// <summary>
	/// </summary>
	/// <returns></returns>
	static NAMESPACE::SURFParams SURFParams(double hessianThreshold)
	{
		return *(NAMESPACE::SURFParams*)&cvSURFParams(hessianThreshold);
	}

	/// <summary>
	/// If useProvidedKeyPts!=0, keypoints are not detected, but descriptors are computed
	/// at the locations provided in keypoints (a CvSeq of CvSURFPoint).
	/// </summary>
	/// <param name="img"></param>
	/// <param name="mask"></param>
	/// <param name="keypoints"></param>
	/// <param name="descriptors"></param>
	/// <param name="storage"></param>
	/// <param name="params"></param>
	static void ExtractSURF(IntPtr img, IntPtr mask, IntPtr keypoints, IntPtr descriptors, IntPtr storage, NAMESPACE::SURFParams params, bool useProvidedKeyPts)
	{
		cvExtractSURF((CvArr*)img.ToPointer(), (CvArr*)mask.ToPointer(), (CvSeq**)keypoints.ToPointer(), (CvSeq**)descriptors.ToPointer(), (CvMemStorage*)storage.ToPointer(), *(CvSURFParams*)&params, (int)useProvidedKeyPts);
	}

	/// <summary>
	/// If useProvidedKeyPts!=0, keypoints are not detected, but descriptors are computed
	/// at the locations provided in keypoints (a CvSeq of CvSURFPoint).
	/// </summary>
	/// <param name="img"></param>
	/// <param name="mask"></param>
	/// <param name="keypoints"></param>
	/// <param name="descriptors"></param>
	/// <param name="storage"></param>
	static void ExtractSURF(IntPtr img, IntPtr mask, IntPtr keypoints, IntPtr descriptors, IntPtr storage, NAMESPACE::SURFParams params)
	{
		cvExtractSURF((CvArr*)img.ToPointer(), (CvArr*)mask.ToPointer(), (CvSeq**)keypoints.ToPointer(), (CvSeq**)descriptors.ToPointer(), (CvMemStorage*)storage.ToPointer(), *(CvSURFParams*)&params);
	}

	/// <summary>
	/// </summary>
	/// <param name="delta"></param>
	/// <param name="min_area"></param>
	/// <param name="max_area"></param>
	/// <param name="max_variation"></param>
	/// <param name="min_diversity"></param>
	/// <param name="max_evolution"></param>
	/// <param name="area_threshold"></param>
	/// <param name="min_margin"></param>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta, int min_area, int max_area, float max_variation, float min_diversity, int max_evolution, double area_threshold, double min_margin, int edge_blur_size)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta, min_area, max_area, max_variation, min_diversity, max_evolution, area_threshold, min_margin, edge_blur_size);
	}

	/// <summary>
	/// </summary>
	/// <param name="delta"></param>
	/// <param name="min_area"></param>
	/// <param name="max_area"></param>
	/// <param name="max_variation"></param>
	/// <param name="min_diversity"></param>
	/// <param name="max_evolution"></param>
	/// <param name="area_threshold"></param>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta, int min_area, int max_area, float max_variation, float min_diversity, int max_evolution, double area_threshold, double min_margin)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta, min_area, max_area, max_variation, min_diversity, max_evolution, area_threshold, min_margin);
	}

	/// <summary>
	/// </summary>
	/// <param name="delta"></param>
	/// <param name="min_area"></param>
	/// <param name="max_area"></param>
	/// <param name="max_variation"></param>
	/// <param name="min_diversity"></param>
	/// <param name="max_evolution"></param>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta, int min_area, int max_area, float max_variation, float min_diversity, int max_evolution, double area_threshold)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta, min_area, max_area, max_variation, min_diversity, max_evolution, area_threshold);
	}

	/// <summary>
	/// </summary>
	/// <param name="delta"></param>
	/// <param name="min_area"></param>
	/// <param name="max_area"></param>
	/// <param name="max_variation"></param>
	/// <param name="min_diversity"></param>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta, int min_area, int max_area, float max_variation, float min_diversity, int max_evolution)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta, min_area, max_area, max_variation, min_diversity, max_evolution);
	}

	/// <summary>
	/// </summary>
	/// <param name="delta"></param>
	/// <param name="min_area"></param>
	/// <param name="max_area"></param>
	/// <param name="max_variation"></param>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta, int min_area, int max_area, float max_variation, float min_diversity)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta, min_area, max_area, max_variation, min_diversity);
	}

	/// <summary>
	/// </summary>
	/// <param name="delta"></param>
	/// <param name="min_area"></param>
	/// <param name="max_area"></param>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta, int min_area, int max_area, float max_variation)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta, min_area, max_area, max_variation);
	}

	/// <summary>
	/// </summary>
	/// <param name="delta"></param>
	/// <param name="min_area"></param>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta, int min_area, int max_area)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta, min_area, max_area);
	}

	/// <summary>
	/// </summary>
	/// <param name="delta"></param>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta, int min_area)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta, min_area);
	}

	/// <summary>
	/// </summary>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams(int delta)
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams(delta);
	}

	/// <summary>
	/// </summary>
	/// <returns></returns>
	static NAMESPACE::MSERParams MSERParams()
	{
		return *(NAMESPACE::MSERParams*)&cvMSERParams();
	}

	/// <summary>
	/// Extracts the contours of Maximally Stable Extremal Regions
	/// </summary>
	/// <param name="_img"></param>
	/// <param name="_mask"></param>
	/// <param name="contours"></param>
	/// <param name="storage"></param>
	static void ExtractMSER(IntPtr _img, IntPtr _mask, IntPtr contours, IntPtr storage, NAMESPACE::MSERParams params)
	{
		cvExtractMSER((CvArr*)_img.ToPointer(), (CvArr*)_mask.ToPointer(), (CvSeq**)contours.ToPointer(), (CvMemStorage*)storage.ToPointer(), *(CvMSERParams*)&params);
	}

	/// <summary>
	/// </summary>
	/// <param name="img"></param>
	/// <param name="storage"></param>
	/// <returns></returns>
	static IntPtr GetStarKeypoints(IntPtr img, IntPtr storage, NAMESPACE::StarDetectorParams params)
	{
		return IntPtr(cvGetStarKeypoints((CvArr*)img.ToPointer(), (CvMemStorage*)storage.ToPointer(), *(CvStarDetectorParams*)&params));
	}

	/// <summary>
	/// </summary>
	/// <param name="img"></param>
	/// <returns></returns>
	static IntPtr GetStarKeypoints(IntPtr img, IntPtr storage)
	{
		return IntPtr(cvGetStarKeypoints((CvArr*)img.ToPointer(), (CvMemStorage*)storage.ToPointer()));
	}

	/// <summary>
	/// Loads haar classifier cascade from a directory.
	/// It is obsolete: convert your cascade to xml and use cvLoad instead
	/// </summary>
	/// <param name="directory"></param>
	/// <returns></returns>
	static IntPtr LoadHaarClassifierCascade(IntPtr directory, NAMESPACE::Point2D32s orig_window_size)
	{
		return IntPtr(cvLoadHaarClassifierCascade((char*)directory.ToPointer(), *(CvSize*)&orig_window_size));
	}

	/// <summary>
	/// </summary>
	static void ReleaseHaarClassifierCascade(IntPtr cascade)
	{
		cvReleaseHaarClassifierCascade((CvHaarClassifierCascade**)cascade.ToPointer());
	}

	/// <summary>
	/// </summary>
	/// <param name="image"></param>
	/// <param name="cascade"></param>
	/// <param name="storage"></param>
	/// <param name="scale_factor"></param>
	/// <param name="min_neighbors"></param>
	/// <param name="flags"></param>
	/// <returns></returns>
	static IntPtr HaarDetectObjects(IntPtr image, IntPtr cascade, IntPtr storage, double scale_factor, int min_neighbors, HaarFlag flags, NAMESPACE::Size2D32s min_size)
	{
		return IntPtr(cvHaarDetectObjects((CvArr*)image.ToPointer(), (CvHaarClassifierCascade*)cascade.ToPointer(), (CvMemStorage*)storage.ToPointer(), scale_factor, min_neighbors, (int)flags, *(CvSize*)&min_size));
	}

	/// <summary>
	/// </summary>
	/// <param name="image"></param>
	/// <param name="cascade"></param>
	/// <param name="storage"></param>
	/// <param name="scale_factor"></param>
	/// <param name="min_neighbors"></param>
	/// <returns></returns>
	static IntPtr HaarDetectObjects(IntPtr image, IntPtr cascade, IntPtr storage, double scale_factor, int min_neighbors, HaarFlag flags)
	{
		return IntPtr(cvHaarDetectObjects((CvArr*)image.ToPointer(), (CvHaarClassifierCascade*)cascade.ToPointer(), (CvMemStorage*)storage.ToPointer(), scale_factor, min_neighbors, (int)flags));
	}

	/// <summary>
	/// </summary>
	/// <param name="image"></param>
	/// <param name="cascade"></param>
	/// <param name="storage"></param>
	/// <param name="scale_factor"></param>
	/// <returns></returns>
	static IntPtr HaarDetectObjects(IntPtr image, IntPtr cascade, IntPtr storage, double scale_factor, int min_neighbors)
	{
		return IntPtr(cvHaarDetectObjects((CvArr*)image.ToPointer(), (CvHaarClassifierCascade*)cascade.ToPointer(), (CvMemStorage*)storage.ToPointer(), scale_factor, min_neighbors));
	}

	/// <summary>
	/// </summary>
	/// <param name="image"></param>
	/// <param name="cascade"></param>
	/// <param name="storage"></param>
	/// <returns></returns>
	static IntPtr HaarDetectObjects(IntPtr image, IntPtr cascade, IntPtr storage, double scale_factor)
	{
		return IntPtr(cvHaarDetectObjects((CvArr*)image.ToPointer(), (CvHaarClassifierCascade*)cascade.ToPointer(), (CvMemStorage*)storage.ToPointer(), scale_factor));
	}

	/// <summary>
	/// </summary>
	/// <param name="image"></param>
	/// <param name="cascade"></param>
	/// <returns></returns>
	static IntPtr HaarDetectObjects(IntPtr image, IntPtr cascade, IntPtr storage)
	{
		return IntPtr(cvHaarDetectObjects((CvArr*)image.ToPointer(), (CvHaarClassifierCascade*)cascade.ToPointer(), (CvMemStorage*)storage.ToPointer()));
	}

	/// <summary>
	/// sets images for haar classifier cascade
	/// </summary>
	/// <param name="cascade"></param>
	/// <param name="sum"></param>
	/// <param name="sqsum"></param>
	/// <param name="tilted_sum"></param>
	static void SetImagesForHaarClassifierCascade(IntPtr cascade, IntPtr sum, IntPtr sqsum, IntPtr tilted_sum, double scale)
	{
		cvSetImagesForHaarClassifierCascade((CvHaarClassifierCascade*)cascade.ToPointer(), (CvArr*)sum.ToPointer(), (CvArr*)sqsum.ToPointer(), (CvArr*)tilted_sum.ToPointer(), scale);
	}

	/// <summary>
	/// runs the cascade on the specified window
	/// </summary>
	/// <param name="cascade"></param>
	/// <param name="pt"></param>
	/// <returns></returns>
	static int RunHaarClassifierCascade(IntPtr cascade, NAMESPACE::Point2D32s pt, bool start_stage)
	{
		return cvRunHaarClassifierCascade((CvHaarClassifierCascade*)cascade.ToPointer(), *(CvPoint*)&pt, (int)start_stage);
	}

	/// <summary>
	/// runs the cascade on the specified window
	/// </summary>
	/// <param name="cascade"></param>
	/// <returns></returns>
	static int RunHaarClassifierCascade(IntPtr cascade, NAMESPACE::Point2D32s pt)
	{
		return cvRunHaarClassifierCascade((CvHaarClassifierCascade*)cascade.ToPointer(), *(CvPoint*)&pt);
	}

	/// <summary>
	/// Transforms the input image to compensate lens distortion
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="camera_matrix"></param>
	static void Undistort2(IntPtr src, IntPtr dst, IntPtr camera_matrix, IntPtr distortion_coeffs)
	{
		cvUndistort2((CvArr*)src.ToPointer(), (CvArr*)dst.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer());
	}

	/// <summary>
	/// Computes transformation map from intrinsic camera parameters
	/// that can used by cvRemap
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="mapx"></param>
	static void InitUndistortMap(IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr mapx, IntPtr mapy)
	{
		cvInitUndistortMap((CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvArr*)mapx.ToPointer(), (CvArr*)mapy.ToPointer());
	}

	/// <summary>
	/// Computes undistortion+rectification map for a head of stereo camera
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="dist_coeffs"></param>
	/// <param name="R"></param>
	/// <param name="new_camera_matrix"></param>
	/// <param name="mapx"></param>
	static void InitUndistortRectifyMap(IntPtr camera_matrix, IntPtr dist_coeffs, IntPtr R, IntPtr new_camera_matrix, IntPtr mapx, IntPtr mapy)
	{
		cvInitUndistortRectifyMap((CvMat*)camera_matrix.ToPointer(), (CvMat*)dist_coeffs.ToPointer(), (CvMat*)R.ToPointer(), (CvMat*)new_camera_matrix.ToPointer(), (CvArr*)mapx.ToPointer(), (CvArr*)mapy.ToPointer());
	}

	/// <summary>
	/// Computes the original (undistorted) feature coordinates
	/// from the observed (distorted) coordinates
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="dist_coeffs"></param>
	/// <param name="R"></param>
	static void UndistortPoints(IntPtr src, IntPtr dst, IntPtr camera_matrix, IntPtr dist_coeffs, IntPtr R, IntPtr P)
	{
		cvUndistortPoints((CvMat*)src.ToPointer(), (CvMat*)dst.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)dist_coeffs.ToPointer(), (CvMat*)R.ToPointer(), (CvMat*)P.ToPointer());
	}

	/// <summary>
	/// Computes the original (undistorted) feature coordinates
	/// from the observed (distorted) coordinates
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="dist_coeffs"></param>
	static void UndistortPoints(IntPtr src, IntPtr dst, IntPtr camera_matrix, IntPtr dist_coeffs, IntPtr R)
	{
		cvUndistortPoints((CvMat*)src.ToPointer(), (CvMat*)dst.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)dist_coeffs.ToPointer(), (CvMat*)R.ToPointer());
	}

	/// <summary>
	/// Computes the original (undistorted) feature coordinates
	/// from the observed (distorted) coordinates
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <param name="camera_matrix"></param>
	static void UndistortPoints(IntPtr src, IntPtr dst, IntPtr camera_matrix, IntPtr dist_coeffs)
	{
		cvUndistortPoints((CvMat*)src.ToPointer(), (CvMat*)dst.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)dist_coeffs.ToPointer());
	}

	/// <summary>
	/// Converts rotation vector to rotation matrix or vice versa
	/// </summary>
	/// <param name="src"></param>
	/// <param name="dst"></param>
	/// <returns></returns>
	static int Rodrigues2(IntPtr src, IntPtr dst, IntPtr jacobian)
	{
		return cvRodrigues2((CvMat*)src.ToPointer(), (CvMat*)dst.ToPointer(), (CvMat*)jacobian.ToPointer());
	}

	/// <summary>
	/// Converts rotation vector to rotation matrix or vice versa
	/// </summary>
	/// <param name="src"></param>
	/// <returns></returns>
	static int Rodrigues2(IntPtr src, IntPtr dst)
	{
		return cvRodrigues2((CvMat*)src.ToPointer(), (CvMat*)dst.ToPointer());
	}

	/// <summary>
	/// Finds perspective transformation between the object plane and image (view) plane
	/// </summary>
	/// <param name="src_points"></param>
	/// <param name="dst_points"></param>
	/// <param name="homography"></param>
	/// <param name="method"></param>
	/// <param name="ransacReprojThreshold"></param>
	/// <returns></returns>
	static int FindHomography(IntPtr src_points, IntPtr dst_points, IntPtr homography, FindHomographyMethod method, double ransacReprojThreshold, IntPtr mask)
	{
		return cvFindHomography((CvMat*)src_points.ToPointer(), (CvMat*)dst_points.ToPointer(), (CvMat*)homography.ToPointer(), (int)method, ransacReprojThreshold, (CvMat*)mask.ToPointer());
	}

	/// <summary>
	/// Finds perspective transformation between the object plane and image (view) plane
	/// </summary>
	/// <param name="src_points"></param>
	/// <param name="dst_points"></param>
	/// <param name="homography"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static int FindHomography(IntPtr src_points, IntPtr dst_points, IntPtr homography, FindHomographyMethod method, double ransacReprojThreshold)
	{
		return cvFindHomography((CvMat*)src_points.ToPointer(), (CvMat*)dst_points.ToPointer(), (CvMat*)homography.ToPointer(),(int) method, ransacReprojThreshold);
	}

	/// <summary>
	/// Finds perspective transformation between the object plane and image (view) plane
	/// </summary>
	/// <param name="src_points"></param>
	/// <param name="dst_points"></param>
	/// <param name="homography"></param>
	/// <returns></returns>
	static int FindHomography(IntPtr src_points, IntPtr dst_points, IntPtr homography, FindHomographyMethod method)
	{
		return cvFindHomography((CvMat*)src_points.ToPointer(), (CvMat*)dst_points.ToPointer(), (CvMat*)homography.ToPointer(), (int)method);
	}

	/// <summary>
	/// Finds perspective transformation between the object plane and image (view) plane
	/// </summary>
	/// <param name="src_points"></param>
	/// <param name="dst_points"></param>
	/// <returns></returns>
	static int FindHomography(IntPtr src_points, IntPtr dst_points, IntPtr homography)
	{
		return cvFindHomography((CvMat*)src_points.ToPointer(), (CvMat*)dst_points.ToPointer(), (CvMat*)homography.ToPointer());
	}

	/// <summary>
	/// Computes RQ decomposition for 3x3 matrices
	/// </summary>
	/// <param name="matrixM"></param>
	/// <param name="matrixR"></param>
	/// <param name="matrixQ"></param>
	/// <param name="matrixQx"></param>
	/// <param name="matrixQy"></param>
	/// <param name="matrixQz"></param>
	static void RQDecomp3x3(IntPtr matrixM, IntPtr matrixR, IntPtr matrixQ, IntPtr matrixQx, IntPtr matrixQy, IntPtr matrixQz, IntPtr eulerAngles)
	{
		cvRQDecomp3x3((CvMat*)matrixM.ToPointer(), (CvMat*)matrixR.ToPointer(), (CvMat*)matrixQ.ToPointer(), (CvMat*)matrixQx.ToPointer(), (CvMat*)matrixQy.ToPointer(), (CvMat*)matrixQz.ToPointer(), (CvPoint3D64f*)eulerAngles.ToPointer());
	}

	/// <summary>
	/// Computes RQ decomposition for 3x3 matrices
	/// </summary>
	/// <param name="matrixM"></param>
	/// <param name="matrixR"></param>
	/// <param name="matrixQ"></param>
	/// <param name="matrixQx"></param>
	/// <param name="matrixQy"></param>
	static void RQDecomp3x3(IntPtr matrixM, IntPtr matrixR, IntPtr matrixQ, IntPtr matrixQx, IntPtr matrixQy, IntPtr matrixQz)
	{
		cvRQDecomp3x3((CvMat*)matrixM.ToPointer(), (CvMat*)matrixR.ToPointer(), (CvMat*)matrixQ.ToPointer(), (CvMat*)matrixQx.ToPointer(), (CvMat*)matrixQy.ToPointer(), (CvMat*)matrixQz.ToPointer());
	}

	/// <summary>
	/// Computes RQ decomposition for 3x3 matrices
	/// </summary>
	/// <param name="matrixM"></param>
	/// <param name="matrixR"></param>
	/// <param name="matrixQ"></param>
	/// <param name="matrixQx"></param>
	static void RQDecomp3x3(IntPtr matrixM, IntPtr matrixR, IntPtr matrixQ, IntPtr matrixQx, IntPtr matrixQy)
	{
		cvRQDecomp3x3((CvMat*)matrixM.ToPointer(), (CvMat*)matrixR.ToPointer(), (CvMat*)matrixQ.ToPointer(), (CvMat*)matrixQx.ToPointer(), (CvMat*)matrixQy.ToPointer());
	}

	/// <summary>
	/// Computes RQ decomposition for 3x3 matrices
	/// </summary>
	/// <param name="matrixM"></param>
	/// <param name="matrixR"></param>
	/// <param name="matrixQ"></param>
	static void RQDecomp3x3(IntPtr matrixM, IntPtr matrixR, IntPtr matrixQ, IntPtr matrixQx)
	{
		cvRQDecomp3x3((CvMat*)matrixM.ToPointer(), (CvMat*)matrixR.ToPointer(), (CvMat*)matrixQ.ToPointer(), (CvMat*)matrixQx.ToPointer());
	}

	/// <summary>
	/// Computes RQ decomposition for 3x3 matrices
	/// </summary>
	/// <param name="matrixM"></param>
	/// <param name="matrixR"></param>
	static void RQDecomp3x3(IntPtr matrixM, IntPtr matrixR, IntPtr matrixQ)
	{
		cvRQDecomp3x3((CvMat*)matrixM.ToPointer(), (CvMat*)matrixR.ToPointer(), (CvMat*)matrixQ.ToPointer());
	}

	/// <summary>
	/// Computes projection matrix decomposition
	/// </summary>
	/// <param name="projMatr"></param>
	/// <param name="calibMatr"></param>
	/// <param name="rotMatr"></param>
	/// <param name="posVect"></param>
	/// <param name="rotMatrX"></param>
	/// <param name="rotMatrY"></param>
	/// <param name="rotMatrZ"></param>
	static void DecomposeProjectionMatrix(IntPtr projMatr, IntPtr calibMatr, IntPtr rotMatr, IntPtr posVect, IntPtr rotMatrX, IntPtr rotMatrY, IntPtr rotMatrZ, IntPtr eulerAngles)
	{
		cvDecomposeProjectionMatrix((CvMat*)projMatr.ToPointer(), (CvMat*)calibMatr.ToPointer(), (CvMat*)rotMatr.ToPointer(), (CvMat*)posVect.ToPointer(), (CvMat*)rotMatrX.ToPointer(), (CvMat*)rotMatrY.ToPointer(), (CvMat*)rotMatrZ.ToPointer(), (CvPoint3D64f*)eulerAngles.ToPointer());
	}

	/// <summary>
	/// Computes projection matrix decomposition
	/// </summary>
	/// <param name="projMatr"></param>
	/// <param name="calibMatr"></param>
	/// <param name="rotMatr"></param>
	/// <param name="posVect"></param>
	/// <param name="rotMatrX"></param>
	/// <param name="rotMatrY"></param>
	static void DecomposeProjectionMatrix(IntPtr projMatr, IntPtr calibMatr, IntPtr rotMatr, IntPtr posVect, IntPtr rotMatrX, IntPtr rotMatrY, IntPtr rotMatrZ)
	{
		cvDecomposeProjectionMatrix((CvMat*)projMatr.ToPointer(), (CvMat*)calibMatr.ToPointer(), (CvMat*)rotMatr.ToPointer(), (CvMat*)posVect.ToPointer(), (CvMat*)rotMatrX.ToPointer(), (CvMat*)rotMatrY.ToPointer(), (CvMat*)rotMatrZ.ToPointer());
	}

	/// <summary>
	/// Computes projection matrix decomposition
	/// </summary>
	/// <param name="projMatr"></param>
	/// <param name="calibMatr"></param>
	/// <param name="rotMatr"></param>
	/// <param name="posVect"></param>
	/// <param name="rotMatrX"></param>
	static void DecomposeProjectionMatrix(IntPtr projMatr, IntPtr calibMatr, IntPtr rotMatr, IntPtr posVect, IntPtr rotMatrX, IntPtr rotMatrY)
	{
		cvDecomposeProjectionMatrix((CvMat*)projMatr.ToPointer(), (CvMat*)calibMatr.ToPointer(), (CvMat*)rotMatr.ToPointer(), (CvMat*)posVect.ToPointer(), (CvMat*)rotMatrX.ToPointer(), (CvMat*)rotMatrY.ToPointer());
	}

	/// <summary>
	/// Computes projection matrix decomposition
	/// </summary>
	/// <param name="projMatr"></param>
	/// <param name="calibMatr"></param>
	/// <param name="rotMatr"></param>
	/// <param name="posVect"></param>
	static void DecomposeProjectionMatrix(IntPtr projMatr, IntPtr calibMatr, IntPtr rotMatr, IntPtr posVect, IntPtr rotMatrX)
	{
		cvDecomposeProjectionMatrix((CvMat*)projMatr.ToPointer(), (CvMat*)calibMatr.ToPointer(), (CvMat*)rotMatr.ToPointer(), (CvMat*)posVect.ToPointer(), (CvMat*)rotMatrX.ToPointer());
	}

	/// <summary>
	/// Computes projection matrix decomposition
	/// </summary>
	/// <param name="projMatr"></param>
	/// <param name="calibMatr"></param>
	/// <param name="rotMatr"></param>
	static void DecomposeProjectionMatrix(IntPtr projMatr, IntPtr calibMatr, IntPtr rotMatr, IntPtr posVect)
	{
		cvDecomposeProjectionMatrix((CvMat*)projMatr.ToPointer(), (CvMat*)calibMatr.ToPointer(), (CvMat*)rotMatr.ToPointer(), (CvMat*)posVect.ToPointer());
	}

	/// <summary>
	/// Computes d(AB)/dA and d(AB)/dB
	/// </summary>
	/// <param name="A"></param>
	/// <param name="B"></param>
	/// <param name="dABdA"></param>
	static void CalcMatMulDeriv(IntPtr A, IntPtr B, IntPtr dABdA, IntPtr dABdB)
	{
		cvCalcMatMulDeriv((CvMat*)A.ToPointer(), (CvMat*)B.ToPointer(), (CvMat*)dABdA.ToPointer(), (CvMat*)dABdB.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	/// <param name="_tvec3"></param>
	/// <param name="dr3dr1"></param>
	/// <param name="dr3dt1"></param>
	/// <param name="dr3dr2"></param>
	/// <param name="dr3dt2"></param>
	/// <param name="dt3dr1"></param>
	/// <param name="dt3dt1"></param>
	/// <param name="dt3dr2"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3, IntPtr dr3dr1, IntPtr dr3dt1, IntPtr dr3dr2, IntPtr dr3dt2, IntPtr dt3dr1, IntPtr dt3dt1, IntPtr dt3dr2, IntPtr dt3dt2)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer(), (CvMat*)dr3dr1.ToPointer(), (CvMat*)dr3dt1.ToPointer(), (CvMat*)dr3dr2.ToPointer(), (CvMat*)dr3dt2.ToPointer(), (CvMat*)dt3dr1.ToPointer(), (CvMat*)dt3dt1.ToPointer(), (CvMat*)dt3dr2.ToPointer(), (CvMat*)dt3dt2.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	/// <param name="_tvec3"></param>
	/// <param name="dr3dr1"></param>
	/// <param name="dr3dt1"></param>
	/// <param name="dr3dr2"></param>
	/// <param name="dr3dt2"></param>
	/// <param name="dt3dr1"></param>
	/// <param name="dt3dt1"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3, IntPtr dr3dr1, IntPtr dr3dt1, IntPtr dr3dr2, IntPtr dr3dt2, IntPtr dt3dr1, IntPtr dt3dt1, IntPtr dt3dr2)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer(), (CvMat*)dr3dr1.ToPointer(), (CvMat*)dr3dt1.ToPointer(), (CvMat*)dr3dr2.ToPointer(), (CvMat*)dr3dt2.ToPointer(), (CvMat*)dt3dr1.ToPointer(), (CvMat*)dt3dt1.ToPointer(), (CvMat*)dt3dr2.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	/// <param name="_tvec3"></param>
	/// <param name="dr3dr1"></param>
	/// <param name="dr3dt1"></param>
	/// <param name="dr3dr2"></param>
	/// <param name="dr3dt2"></param>
	/// <param name="dt3dr1"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3, IntPtr dr3dr1, IntPtr dr3dt1, IntPtr dr3dr2, IntPtr dr3dt2, IntPtr dt3dr1, IntPtr dt3dt1)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer(), (CvMat*)dr3dr1.ToPointer(), (CvMat*)dr3dt1.ToPointer(), (CvMat*)dr3dr2.ToPointer(), (CvMat*)dr3dt2.ToPointer(), (CvMat*)dt3dr1.ToPointer(), (CvMat*)dt3dt1.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	/// <param name="_tvec3"></param>
	/// <param name="dr3dr1"></param>
	/// <param name="dr3dt1"></param>
	/// <param name="dr3dr2"></param>
	/// <param name="dr3dt2"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3, IntPtr dr3dr1, IntPtr dr3dt1, IntPtr dr3dr2, IntPtr dr3dt2, IntPtr dt3dr1)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer(), (CvMat*)dr3dr1.ToPointer(), (CvMat*)dr3dt1.ToPointer(), (CvMat*)dr3dr2.ToPointer(), (CvMat*)dr3dt2.ToPointer(), (CvMat*)dt3dr1.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	/// <param name="_tvec3"></param>
	/// <param name="dr3dr1"></param>
	/// <param name="dr3dt1"></param>
	/// <param name="dr3dr2"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3, IntPtr dr3dr1, IntPtr dr3dt1, IntPtr dr3dr2, IntPtr dr3dt2)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer(), (CvMat*)dr3dr1.ToPointer(), (CvMat*)dr3dt1.ToPointer(), (CvMat*)dr3dr2.ToPointer(), (CvMat*)dr3dt2.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	/// <param name="_tvec3"></param>
	/// <param name="dr3dr1"></param>
	/// <param name="dr3dt1"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3, IntPtr dr3dr1, IntPtr dr3dt1, IntPtr dr3dr2)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer(), (CvMat*)dr3dr1.ToPointer(), (CvMat*)dr3dt1.ToPointer(), (CvMat*)dr3dr2.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	/// <param name="_tvec3"></param>
	/// <param name="dr3dr1"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3, IntPtr dr3dr1, IntPtr dr3dt1)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer(), (CvMat*)dr3dr1.ToPointer(), (CvMat*)dr3dt1.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	/// <param name="_tvec3"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3, IntPtr dr3dr1)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer(), (CvMat*)dr3dr1.ToPointer());
	}

	/// <summary>
	/// Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),
	/// t3 = rodrigues(r2)*t1 + t2 and the respective derivatives
	/// </summary>
	/// <param name="_rvec1"></param>
	/// <param name="_tvec1"></param>
	/// <param name="_rvec2"></param>
	/// <param name="_tvec2"></param>
	/// <param name="_rvec3"></param>
	static void ComposeRT(IntPtr _rvec1, IntPtr _tvec1, IntPtr _rvec2, IntPtr _tvec2, IntPtr _rvec3, IntPtr _tvec3)
	{
		cvComposeRT((CvMat*)_rvec1.ToPointer(), (CvMat*)_tvec1.ToPointer(), (CvMat*)_rvec2.ToPointer(), (CvMat*)_tvec2.ToPointer(), (CvMat*)_rvec3.ToPointer(), (CvMat*)_tvec3.ToPointer());
	}

	/// <summary>
	/// Projects object points to the view plane using
	/// the specified extrinsic and intrinsic camera parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="rotation_vector"></param>
	/// <param name="translation_vector"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="image_points"></param>
	/// <param name="dpdrot"></param>
	/// <param name="dpdt"></param>
	/// <param name="dpdf"></param>
	/// <param name="dpdc"></param>
	/// <param name="dpddist"></param>
	static void ProjectPoints2(IntPtr object_points, IntPtr rotation_vector, IntPtr translation_vector, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr image_points, IntPtr dpdrot, IntPtr dpdt, IntPtr dpdf, IntPtr dpdc, IntPtr dpddist, double aspect_ratio)
	{
		cvProjectPoints2((CvMat*)object_points.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)dpdrot.ToPointer(), (CvMat*)dpdt.ToPointer(), (CvMat*)dpdf.ToPointer(), (CvMat*)dpdc.ToPointer(), (CvMat*)dpddist.ToPointer(), aspect_ratio);
	}

	/// <summary>
	/// Projects object points to the view plane using
	/// the specified extrinsic and intrinsic camera parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="rotation_vector"></param>
	/// <param name="translation_vector"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="image_points"></param>
	/// <param name="dpdrot"></param>
	/// <param name="dpdt"></param>
	/// <param name="dpdf"></param>
	/// <param name="dpdc"></param>
	static void ProjectPoints2(IntPtr object_points, IntPtr rotation_vector, IntPtr translation_vector, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr image_points, IntPtr dpdrot, IntPtr dpdt, IntPtr dpdf, IntPtr dpdc, IntPtr dpddist)
	{
		cvProjectPoints2((CvMat*)object_points.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)dpdrot.ToPointer(), (CvMat*)dpdt.ToPointer(), (CvMat*)dpdf.ToPointer(), (CvMat*)dpdc.ToPointer(), (CvMat*)dpddist.ToPointer());
	}

	/// <summary>
	/// Projects object points to the view plane using
	/// the specified extrinsic and intrinsic camera parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="rotation_vector"></param>
	/// <param name="translation_vector"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="image_points"></param>
	/// <param name="dpdrot"></param>
	/// <param name="dpdt"></param>
	/// <param name="dpdf"></param>
	static void ProjectPoints2(IntPtr object_points, IntPtr rotation_vector, IntPtr translation_vector, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr image_points, IntPtr dpdrot, IntPtr dpdt, IntPtr dpdf, IntPtr dpdc)
	{
		cvProjectPoints2((CvMat*)object_points.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)dpdrot.ToPointer(), (CvMat*)dpdt.ToPointer(), (CvMat*)dpdf.ToPointer(), (CvMat*)dpdc.ToPointer());
	}

	/// <summary>
	/// Projects object points to the view plane using
	/// the specified extrinsic and intrinsic camera parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="rotation_vector"></param>
	/// <param name="translation_vector"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="image_points"></param>
	/// <param name="dpdrot"></param>
	/// <param name="dpdt"></param>
	static void ProjectPoints2(IntPtr object_points, IntPtr rotation_vector, IntPtr translation_vector, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr image_points, IntPtr dpdrot, IntPtr dpdt, IntPtr dpdf)
	{
		cvProjectPoints2((CvMat*)object_points.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)dpdrot.ToPointer(), (CvMat*)dpdt.ToPointer(), (CvMat*)dpdf.ToPointer());
	}

	/// <summary>
	/// Projects object points to the view plane using
	/// the specified extrinsic and intrinsic camera parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="rotation_vector"></param>
	/// <param name="translation_vector"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="image_points"></param>
	/// <param name="dpdrot"></param>
	static void ProjectPoints2(IntPtr object_points, IntPtr rotation_vector, IntPtr translation_vector, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr image_points, IntPtr dpdrot, IntPtr dpdt)
	{
		cvProjectPoints2((CvMat*)object_points.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)dpdrot.ToPointer(), (CvMat*)dpdt.ToPointer());
	}

	/// <summary>
	/// Projects object points to the view plane using
	/// the specified extrinsic and intrinsic camera parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="rotation_vector"></param>
	/// <param name="translation_vector"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="image_points"></param>
	static void ProjectPoints2(IntPtr object_points, IntPtr rotation_vector, IntPtr translation_vector, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr image_points, IntPtr dpdrot)
	{
		cvProjectPoints2((CvMat*)object_points.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)dpdrot.ToPointer());
	}

	/// <summary>
	/// Projects object points to the view plane using
	/// the specified extrinsic and intrinsic camera parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="rotation_vector"></param>
	/// <param name="translation_vector"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	static void ProjectPoints2(IntPtr object_points, IntPtr rotation_vector, IntPtr translation_vector, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr image_points)
	{
		cvProjectPoints2((CvMat*)object_points.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)image_points.ToPointer());
	}

	/// <summary>
	/// Finds extrinsic camera parameters from
	/// a few known corresponding point pairs and intrinsic parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="rotation_vector"></param>
	/// <param name="translation_vector"></param>
	static void FindExtrinsicCameraParams2(IntPtr object_points, IntPtr image_points, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr rotation_vector, IntPtr translation_vector, int use_extrinsic_guess)
	{
		cvFindExtrinsicCameraParams2((CvMat*)object_points.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer(), use_extrinsic_guess);
	}

	/// <summary>
	/// Finds extrinsic camera parameters from
	/// a few known corresponding point pairs and intrinsic parameters
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="rotation_vector"></param>
	static void FindExtrinsicCameraParams2(IntPtr object_points, IntPtr image_points, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr rotation_vector, IntPtr translation_vector)
	{
		cvFindExtrinsicCameraParams2((CvMat*)object_points.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)rotation_vector.ToPointer(), (CvMat*)translation_vector.ToPointer());
	}

	/// <summary>
	/// Computes initial estimate of the intrinsic camera parameters
	/// in case of planar calibration target (e.g. chessboard)
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points"></param>
	/// <param name="npoints"></param>
	/// <param name="image_size"></param>
	/// <param name="camera_matrix"></param>
	static void InitIntrinsicParams2D(IntPtr object_points, IntPtr image_points, IntPtr npoints, NAMESPACE::Size2D32s image_size, IntPtr camera_matrix, double aspect_ratio)
	{
		cvInitIntrinsicParams2D((CvMat*)object_points.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)npoints.ToPointer(), *(CvSize*)&image_size, (CvMat*)camera_matrix.ToPointer(), aspect_ratio);
	}

	/// <summary>
	/// Computes initial estimate of the intrinsic camera parameters
	/// in case of planar calibration target (e.g. chessboard)
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points"></param>
	/// <param name="npoints"></param>
	/// <param name="image_size"></param>
	static void InitIntrinsicParams2D(IntPtr object_points, IntPtr image_points, IntPtr npoints, NAMESPACE::Size2D32s image_size, IntPtr camera_matrix)
	{
		cvInitIntrinsicParams2D((CvMat*)object_points.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)npoints.ToPointer(), *(CvSize*)&image_size, (CvMat*)camera_matrix.ToPointer());
	}

	/// <summary>
	/// Detects corners on a chessboard calibration pattern
	/// </summary>
	/// <param name="image"></param>
	/// <param name="pattern_size"></param>
	/// <param name="corners"></param>
	/// <param name="corner_count"></param>
	/// <returns></returns>
	static int FindChessboardCorners(IntPtr image, NAMESPACE::Size2D32s pattern_size, IntPtr corners, IntPtr corner_count, FindChessboardCornerFlag flags)
	{
		return cvFindChessboardCorners((void*)image.ToPointer(), *(CvSize*)&pattern_size, (CvPoint2D32f*)corners.ToPointer(), (int*)corner_count.ToPointer(), (int)flags);
	}

	/// <summary>
	/// Detects corners on a chessboard calibration pattern
	/// </summary>
	/// <param name="image"></param>
	/// <param name="pattern_size"></param>
	/// <param name="corners"></param>
	/// <returns></returns>
	static int FindChessboardCorners(IntPtr image, NAMESPACE::Size2D32s pattern_size, IntPtr corners, IntPtr corner_count)
	{
		return cvFindChessboardCorners((void*)image.ToPointer(), *(CvSize*)&pattern_size, (CvPoint2D32f*)corners.ToPointer(), (int*)corner_count.ToPointer());
	}

	/// <summary>
	/// Detects corners on a chessboard calibration pattern
	/// </summary>
	/// <param name="image"></param>
	/// <param name="pattern_size"></param>
	/// <returns></returns>
	static int FindChessboardCorners(IntPtr image, NAMESPACE::Size2D32s pattern_size, IntPtr corners)
	{
		return cvFindChessboardCorners((void*)image.ToPointer(), *(CvSize*)&pattern_size, (CvPoint2D32f*)corners.ToPointer());
	}

	/// <summary>
	/// Draws individual chessboard corners or the whole chessboard detected
	/// </summary>
	/// <param name="image"></param>
	/// <param name="pattern_size"></param>
	/// <param name="corners"></param>
	/// <param name="count"></param>
	static void DrawChessboardCorners(IntPtr image, NAMESPACE::Size2D32s pattern_size, IntPtr corners, int count, int pattern_was_found)
	{
		cvDrawChessboardCorners((CvArr*)image.ToPointer(), *(CvSize*)&pattern_size, (CvPoint2D32f*)corners.ToPointer(), count, pattern_was_found);
	}

	/// <summary>
	/// Finds intrinsic and extrinsic camera parameters
	/// from a few views of known calibration pattern
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points"></param>
	/// <param name="point_counts"></param>
	/// <param name="image_size"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="rotation_vectors"></param>
	/// <param name="translation_vectors"></param>
	static void CalibrateCamera2(IntPtr object_points, IntPtr image_points, IntPtr point_counts, NAMESPACE::Size2D32s image_size, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr rotation_vectors, IntPtr translation_vectors, CalibrateCamraFlag flags)
	{
		cvCalibrateCamera2((CvMat*)object_points.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)point_counts.ToPointer(), *(CvSize*)&image_size, (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)rotation_vectors.ToPointer(), (CvMat*)translation_vectors.ToPointer(), (int)flags);
	}

	/// <summary>
	/// Finds intrinsic and extrinsic camera parameters
	/// from a few views of known calibration pattern
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points"></param>
	/// <param name="point_counts"></param>
	/// <param name="image_size"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	/// <param name="rotation_vectors"></param>
	static void CalibrateCamera2(IntPtr object_points, IntPtr image_points, IntPtr point_counts, NAMESPACE::Size2D32s image_size, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr rotation_vectors, IntPtr translation_vectors)
	{
		cvCalibrateCamera2((CvMat*)object_points.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)point_counts.ToPointer(), *(CvSize*)&image_size, (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)rotation_vectors.ToPointer(), (CvMat*)translation_vectors.ToPointer());
	}

	/// <summary>
	/// Finds intrinsic and extrinsic camera parameters
	/// from a few views of known calibration pattern
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points"></param>
	/// <param name="point_counts"></param>
	/// <param name="image_size"></param>
	/// <param name="camera_matrix"></param>
	/// <param name="distortion_coeffs"></param>
	static void CalibrateCamera2(IntPtr object_points, IntPtr image_points, IntPtr point_counts, NAMESPACE::Size2D32s image_size, IntPtr camera_matrix, IntPtr distortion_coeffs, IntPtr rotation_vectors)
	{
		cvCalibrateCamera2((CvMat*)object_points.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)point_counts.ToPointer(), *(CvSize*)&image_size, (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer(), (CvMat*)rotation_vectors.ToPointer());
	}

	/// <summary>
	/// Finds intrinsic and extrinsic camera parameters
	/// from a few views of known calibration pattern
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points"></param>
	/// <param name="point_counts"></param>
	/// <param name="image_size"></param>
	/// <param name="camera_matrix"></param>
	static void CalibrateCamera2(IntPtr object_points, IntPtr image_points, IntPtr point_counts, NAMESPACE::Size2D32s image_size, IntPtr camera_matrix, IntPtr distortion_coeffs)
	{
		cvCalibrateCamera2((CvMat*)object_points.ToPointer(), (CvMat*)image_points.ToPointer(), (CvMat*)point_counts.ToPointer(), *(CvSize*)&image_size, (CvMat*)camera_matrix.ToPointer(), (CvMat*)distortion_coeffs.ToPointer());
	}

	/// <summary>
	/// Computes various useful characteristics of the camera from the data computed by
	/// cvCalibrateCamera2
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="image_size"></param>
	/// <param name="aperture_width"></param>
	/// <param name="aperture_height"></param>
	/// <param name="fovx"></param>
	/// <param name="fovy"></param>
	/// <param name="focal_length"></param>
	/// <param name="principal_point"></param>
	static void CalibrationMatrixValues(IntPtr camera_matrix, NAMESPACE::Size2D32s image_size, double aperture_width, double aperture_height, IntPtr fovx, IntPtr fovy, IntPtr focal_length, IntPtr principal_point, IntPtr pixel_aspect_ratio)
	{
		cvCalibrationMatrixValues((CvMat*)camera_matrix.ToPointer(), *(CvSize*)&image_size, aperture_width, aperture_height, (double*)fovx.ToPointer(), (double*)fovy.ToPointer(), (double*)focal_length.ToPointer(), (CvPoint2D64f*)principal_point.ToPointer(), (double*)pixel_aspect_ratio.ToPointer());
	}

	/// <summary>
	/// Computes various useful characteristics of the camera from the data computed by
	/// cvCalibrateCamera2
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="image_size"></param>
	/// <param name="aperture_width"></param>
	/// <param name="aperture_height"></param>
	/// <param name="fovx"></param>
	/// <param name="fovy"></param>
	/// <param name="focal_length"></param>
	static void CalibrationMatrixValues(IntPtr camera_matrix, NAMESPACE::Size2D32s image_size, double aperture_width, double aperture_height, IntPtr fovx, IntPtr fovy, IntPtr focal_length, IntPtr principal_point)
	{
		cvCalibrationMatrixValues((CvMat*)camera_matrix.ToPointer(), *(CvSize*)&image_size, aperture_width, aperture_height, (double*)fovx.ToPointer(), (double*)fovy.ToPointer(), (double*)focal_length.ToPointer(), (CvPoint2D64f*)principal_point.ToPointer());
	}

	/// <summary>
	/// Computes various useful characteristics of the camera from the data computed by
	/// cvCalibrateCamera2
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="image_size"></param>
	/// <param name="aperture_width"></param>
	/// <param name="aperture_height"></param>
	/// <param name="fovx"></param>
	/// <param name="fovy"></param>
	static void CalibrationMatrixValues(IntPtr camera_matrix, NAMESPACE::Size2D32s image_size, double aperture_width, double aperture_height, IntPtr fovx, IntPtr fovy, IntPtr focal_length)
	{
		cvCalibrationMatrixValues((CvMat*)camera_matrix.ToPointer(), *(CvSize*)&image_size, aperture_width, aperture_height, (double*)fovx.ToPointer(), (double*)fovy.ToPointer(), (double*)focal_length.ToPointer());
	}

	/// <summary>
	/// Computes various useful characteristics of the camera from the data computed by
	/// cvCalibrateCamera2
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="image_size"></param>
	/// <param name="aperture_width"></param>
	/// <param name="aperture_height"></param>
	/// <param name="fovx"></param>
	static void CalibrationMatrixValues(IntPtr camera_matrix, NAMESPACE::Size2D32s image_size, double aperture_width, double aperture_height, IntPtr fovx, IntPtr fovy)
	{
		cvCalibrationMatrixValues((CvMat*)camera_matrix.ToPointer(), *(CvSize*)&image_size, aperture_width, aperture_height, (double*)fovx.ToPointer(), (double*)fovy.ToPointer());
	}

	/// <summary>
	/// Computes various useful characteristics of the camera from the data computed by
	/// cvCalibrateCamera2
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="image_size"></param>
	/// <param name="aperture_width"></param>
	/// <param name="aperture_height"></param>
	static void CalibrationMatrixValues(IntPtr camera_matrix, NAMESPACE::Size2D32s image_size, double aperture_width, double aperture_height, IntPtr fovx)
	{
		cvCalibrationMatrixValues((CvMat*)camera_matrix.ToPointer(), *(CvSize*)&image_size, aperture_width, aperture_height, (double*)fovx.ToPointer());
	}

	/// <summary>
	/// Computes various useful characteristics of the camera from the data computed by
	/// cvCalibrateCamera2
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="image_size"></param>
	/// <param name="aperture_width"></param>
	static void CalibrationMatrixValues(IntPtr camera_matrix, NAMESPACE::Size2D32s image_size, double aperture_width, double aperture_height)
	{
		cvCalibrationMatrixValues((CvMat*)camera_matrix.ToPointer(), *(CvSize*)&image_size, aperture_width, aperture_height);
	}

	/// <summary>
	/// Computes various useful characteristics of the camera from the data computed by
	/// cvCalibrateCamera2
	/// </summary>
	/// <param name="camera_matrix"></param>
	/// <param name="image_size"></param>
	static void CalibrationMatrixValues(IntPtr camera_matrix, NAMESPACE::Size2D32s image_size, double aperture_width)
	{
		cvCalibrationMatrixValues((CvMat*)camera_matrix.ToPointer(), *(CvSize*)&image_size, aperture_width);
	}

	/// <summary>
	/// Computes various useful characteristics of the camera from the data computed by
	/// cvCalibrateCamera2
	/// </summary>
	/// <param name="camera_matrix"></param>
	static void CalibrationMatrixValues(IntPtr camera_matrix, NAMESPACE::Size2D32s image_size)
	{
		cvCalibrationMatrixValues((CvMat*)camera_matrix.ToPointer(), *(CvSize*)&image_size);
	}

	/// <summary>
	/// Computes the transformation from one camera coordinate system to another one
	/// from a few correspondent views of the same calibration target. Optionally, calibrates
	/// both cameras
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points1"></param>
	/// <param name="image_points2"></param>
	/// <param name="npoints"></param>
	/// <param name="camera_matrix1"></param>
	/// <param name="dist_coeffs1"></param>
	/// <param name="camera_matrix2"></param>
	/// <param name="dist_coeffs2"></param>
	/// <param name="image_size"></param>
	/// <param name="R"></param>
	/// <param name="T"></param>
	/// <param name="E"></param>
	/// <param name="F"></param>
	/// <param name="term_crit"></param>
	static void StereoCalibrate(IntPtr object_points, IntPtr image_points1, IntPtr image_points2, IntPtr npoints, IntPtr camera_matrix1, IntPtr dist_coeffs1, IntPtr camera_matrix2, IntPtr dist_coeffs2, NAMESPACE::Size2D32s image_size, IntPtr R, IntPtr T, IntPtr E, IntPtr F, NAMESPACE::TermCriteria term_crit, int flags)
	{
		cvStereoCalibrate((CvMat*)object_points.ToPointer(), (CvMat*)image_points1.ToPointer(), (CvMat*)image_points2.ToPointer(), (CvMat*)npoints.ToPointer(), (CvMat*)camera_matrix1.ToPointer(), (CvMat*)dist_coeffs1.ToPointer(), (CvMat*)camera_matrix2.ToPointer(), (CvMat*)dist_coeffs2.ToPointer(), *(CvSize*)&image_size, (CvMat*)R.ToPointer(), (CvMat*)T.ToPointer(), (CvMat*)E.ToPointer(), (CvMat*)F.ToPointer(), *(CvTermCriteria*)&term_crit, flags);
	}

	/// <summary>
	/// Computes the transformation from one camera coordinate system to another one
	/// from a few correspondent views of the same calibration target. Optionally, calibrates
	/// both cameras
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points1"></param>
	/// <param name="image_points2"></param>
	/// <param name="npoints"></param>
	/// <param name="camera_matrix1"></param>
	/// <param name="dist_coeffs1"></param>
	/// <param name="camera_matrix2"></param>
	/// <param name="dist_coeffs2"></param>
	/// <param name="image_size"></param>
	/// <param name="R"></param>
	/// <param name="T"></param>
	/// <param name="E"></param>
	/// <param name="F"></param>
	static void StereoCalibrate(IntPtr object_points, IntPtr image_points1, IntPtr image_points2, IntPtr npoints, IntPtr camera_matrix1, IntPtr dist_coeffs1, IntPtr camera_matrix2, IntPtr dist_coeffs2, NAMESPACE::Size2D32s image_size, IntPtr R, IntPtr T, IntPtr E, IntPtr F, NAMESPACE::TermCriteria term_crit)
	{
		cvStereoCalibrate((CvMat*)object_points.ToPointer(), (CvMat*)image_points1.ToPointer(), (CvMat*)image_points2.ToPointer(), (CvMat*)npoints.ToPointer(), (CvMat*)camera_matrix1.ToPointer(), (CvMat*)dist_coeffs1.ToPointer(), (CvMat*)camera_matrix2.ToPointer(), (CvMat*)dist_coeffs2.ToPointer(), *(CvSize*)&image_size, (CvMat*)R.ToPointer(), (CvMat*)T.ToPointer(), (CvMat*)E.ToPointer(), (CvMat*)F.ToPointer(), *(CvTermCriteria*)&term_crit);
	}

	/// <summary>
	/// Computes the transformation from one camera coordinate system to another one
	/// from a few correspondent views of the same calibration target. Optionally, calibrates
	/// both cameras
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points1"></param>
	/// <param name="image_points2"></param>
	/// <param name="npoints"></param>
	/// <param name="camera_matrix1"></param>
	/// <param name="dist_coeffs1"></param>
	/// <param name="camera_matrix2"></param>
	/// <param name="dist_coeffs2"></param>
	/// <param name="image_size"></param>
	/// <param name="R"></param>
	/// <param name="T"></param>
	/// <param name="E"></param>
	static void StereoCalibrate(IntPtr object_points, IntPtr image_points1, IntPtr image_points2, IntPtr npoints, IntPtr camera_matrix1, IntPtr dist_coeffs1, IntPtr camera_matrix2, IntPtr dist_coeffs2, NAMESPACE::Size2D32s image_size, IntPtr R, IntPtr T, IntPtr E, IntPtr F)
	{
		cvStereoCalibrate((CvMat*)object_points.ToPointer(), (CvMat*)image_points1.ToPointer(), (CvMat*)image_points2.ToPointer(), (CvMat*)npoints.ToPointer(), (CvMat*)camera_matrix1.ToPointer(), (CvMat*)dist_coeffs1.ToPointer(), (CvMat*)camera_matrix2.ToPointer(), (CvMat*)dist_coeffs2.ToPointer(), *(CvSize*)&image_size, (CvMat*)R.ToPointer(), (CvMat*)T.ToPointer(), (CvMat*)E.ToPointer(), (CvMat*)F.ToPointer());
	}

	/// <summary>
	/// Computes the transformation from one camera coordinate system to another one
	/// from a few correspondent views of the same calibration target. Optionally, calibrates
	/// both cameras
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points1"></param>
	/// <param name="image_points2"></param>
	/// <param name="npoints"></param>
	/// <param name="camera_matrix1"></param>
	/// <param name="dist_coeffs1"></param>
	/// <param name="camera_matrix2"></param>
	/// <param name="dist_coeffs2"></param>
	/// <param name="image_size"></param>
	/// <param name="R"></param>
	/// <param name="T"></param>
	static void StereoCalibrate(IntPtr object_points, IntPtr image_points1, IntPtr image_points2, IntPtr npoints, IntPtr camera_matrix1, IntPtr dist_coeffs1, IntPtr camera_matrix2, IntPtr dist_coeffs2, NAMESPACE::Size2D32s image_size, IntPtr R, IntPtr T, IntPtr E)
	{
		cvStereoCalibrate((CvMat*)object_points.ToPointer(), (CvMat*)image_points1.ToPointer(), (CvMat*)image_points2.ToPointer(), (CvMat*)npoints.ToPointer(), (CvMat*)camera_matrix1.ToPointer(), (CvMat*)dist_coeffs1.ToPointer(), (CvMat*)camera_matrix2.ToPointer(), (CvMat*)dist_coeffs2.ToPointer(), *(CvSize*)&image_size, (CvMat*)R.ToPointer(), (CvMat*)T.ToPointer(), (CvMat*)E.ToPointer());
	}

	/// <summary>
	/// Computes the transformation from one camera coordinate system to another one
	/// from a few correspondent views of the same calibration target. Optionally, calibrates
	/// both cameras
	/// </summary>
	/// <param name="object_points"></param>
	/// <param name="image_points1"></param>
	/// <param name="image_points2"></param>
	/// <param name="npoints"></param>
	/// <param name="camera_matrix1"></param>
	/// <param name="dist_coeffs1"></param>
	/// <param name="camera_matrix2"></param>
	/// <param name="dist_coeffs2"></param>
	/// <param name="image_size"></param>
	/// <param name="R"></param>
	static void StereoCalibrate(IntPtr object_points, IntPtr image_points1, IntPtr image_points2, IntPtr npoints, IntPtr camera_matrix1, IntPtr dist_coeffs1, IntPtr camera_matrix2, IntPtr dist_coeffs2, NAMESPACE::Size2D32s image_size, IntPtr R, IntPtr T)
	{
		cvStereoCalibrate((CvMat*)object_points.ToPointer(), (CvMat*)image_points1.ToPointer(), (CvMat*)image_points2.ToPointer(), (CvMat*)npoints.ToPointer(), (CvMat*)camera_matrix1.ToPointer(), (CvMat*)dist_coeffs1.ToPointer(), (CvMat*)camera_matrix2.ToPointer(), (CvMat*)dist_coeffs2.ToPointer(), *(CvSize*)&image_size, (CvMat*)R.ToPointer(), (CvMat*)T.ToPointer());
	}

	/// <summary>
	/// Computes 3D rotations (+ optional shift) for each camera coordinate system to make both
	/// views parallel (=> to make all the epipolar lines horizontal or vertical)
	/// </summary>
	/// <param name="camera_matrix1"></param>
	/// <param name="camera_matrix2"></param>
	/// <param name="dist_coeffs1"></param>
	/// <param name="dist_coeffs2"></param>
	/// <param name="image_size"></param>
	/// <param name="R"></param>
	/// <param name="T"></param>
	/// <param name="R1"></param>
	/// <param name="R2"></param>
	/// <param name="P1"></param>
	/// <param name="P2"></param>
	/// <param name="Q"></param>
	static void StereoRectify(IntPtr camera_matrix1, IntPtr camera_matrix2, IntPtr dist_coeffs1, IntPtr dist_coeffs2, NAMESPACE::Size2D32s image_size, IntPtr R, IntPtr T, IntPtr R1, IntPtr R2, IntPtr P1, IntPtr P2, IntPtr Q, int flags)
	{
		cvStereoRectify((CvMat*)camera_matrix1.ToPointer(), (CvMat*)camera_matrix2.ToPointer(), (CvMat*)dist_coeffs1.ToPointer(), (CvMat*)dist_coeffs2.ToPointer(), *(CvSize*)&image_size, (CvMat*)R.ToPointer(), (CvMat*)T.ToPointer(), (CvMat*)R1.ToPointer(), (CvMat*)R2.ToPointer(), (CvMat*)P1.ToPointer(), (CvMat*)P2.ToPointer(), (CvMat*)Q.ToPointer(), flags);
	}

	/// <summary>
	/// Computes 3D rotations (+ optional shift) for each camera coordinate system to make both
	/// views parallel (=> to make all the epipolar lines horizontal or vertical)
	/// </summary>
	/// <param name="camera_matrix1"></param>
	/// <param name="camera_matrix2"></param>
	/// <param name="dist_coeffs1"></param>
	/// <param name="dist_coeffs2"></param>
	/// <param name="image_size"></param>
	/// <param name="R"></param>
	/// <param name="T"></param>
	/// <param name="R1"></param>
	/// <param name="R2"></param>
	/// <param name="P1"></param>
	/// <param name="P2"></param>
	static void StereoRectify(IntPtr camera_matrix1, IntPtr camera_matrix2, IntPtr dist_coeffs1, IntPtr dist_coeffs2, NAMESPACE::Size2D32s image_size, IntPtr R, IntPtr T, IntPtr R1, IntPtr R2, IntPtr P1, IntPtr P2, IntPtr Q)
	{
		cvStereoRectify((CvMat*)camera_matrix1.ToPointer(), (CvMat*)camera_matrix2.ToPointer(), (CvMat*)dist_coeffs1.ToPointer(), (CvMat*)dist_coeffs2.ToPointer(), *(CvSize*)&image_size, (CvMat*)R.ToPointer(), (CvMat*)T.ToPointer(), (CvMat*)R1.ToPointer(), (CvMat*)R2.ToPointer(), (CvMat*)P1.ToPointer(), (CvMat*)P2.ToPointer(), (CvMat*)Q.ToPointer());
	}

	/// <summary>
	/// Computes 3D rotations (+ optional shift) for each camera coordinate system to make both
	/// views parallel (=> to make all the epipolar lines horizontal or vertical)
	/// </summary>
	/// <param name="camera_matrix1"></param>
	/// <param name="camera_matrix2"></param>
	/// <param name="dist_coeffs1"></param>
	/// <param name="dist_coeffs2"></param>
	/// <param name="image_size"></param>
	/// <param name="R"></param>
	/// <param name="T"></param>
	/// <param name="R1"></param>
	/// <param name="R2"></param>
	/// <param name="P1"></param>
	static void StereoRectify(IntPtr camera_matrix1, IntPtr camera_matrix2, IntPtr dist_coeffs1, IntPtr dist_coeffs2, NAMESPACE::Size2D32s image_size, IntPtr R, IntPtr T, IntPtr R1, IntPtr R2, IntPtr P1, IntPtr P2)
	{
		cvStereoRectify((CvMat*)camera_matrix1.ToPointer(), (CvMat*)camera_matrix2.ToPointer(), (CvMat*)dist_coeffs1.ToPointer(), (CvMat*)dist_coeffs2.ToPointer(), *(CvSize*)&image_size, (CvMat*)R.ToPointer(), (CvMat*)T.ToPointer(), (CvMat*)R1.ToPointer(), (CvMat*)R2.ToPointer(), (CvMat*)P1.ToPointer(), (CvMat*)P2.ToPointer());
	}

	/// <summary>
	/// Computes rectification transformations for uncalibrated pair of images using a set
	/// of point correspondences
	/// </summary>
	/// <param name="points1"></param>
	/// <param name="points2"></param>
	/// <param name="F"></param>
	/// <param name="img_size"></param>
	/// <param name="H1"></param>
	/// <param name="H2"></param>
	/// <returns></returns>
	static int StereoRectifyUncalibrated(IntPtr points1, IntPtr points2, IntPtr F, NAMESPACE::Size2D32s img_size, IntPtr H1, IntPtr H2, double threshold)
	{
		return cvStereoRectifyUncalibrated((CvMat*)points1.ToPointer(), (CvMat*)points2.ToPointer(), (CvMat*)F.ToPointer(), *(CvSize*)&img_size, (CvMat*)H1.ToPointer(), (CvMat*)H2.ToPointer(), threshold);
	}

	/// <summary>
	/// Computes rectification transformations for uncalibrated pair of images using a set
	/// of point correspondences
	/// </summary>
	/// <param name="points1"></param>
	/// <param name="points2"></param>
	/// <param name="F"></param>
	/// <param name="img_size"></param>
	/// <param name="H1"></param>
	/// <returns></returns>
	static int StereoRectifyUncalibrated(IntPtr points1, IntPtr points2, IntPtr F, NAMESPACE::Size2D32s img_size, IntPtr H1, IntPtr H2)
	{
		return cvStereoRectifyUncalibrated((CvMat*)points1.ToPointer(), (CvMat*)points2.ToPointer(), (CvMat*)F.ToPointer(), *(CvSize*)&img_size, (CvMat*)H1.ToPointer(), (CvMat*)H2.ToPointer());
	}

	/// <summary>
	/// Allocates and initializes CvPOSITObject structure before doing cvPOSIT
	/// </summary>
	/// <param name="points"></param>
	/// <returns></returns>
	static IntPtr CreatePOSITObject(IntPtr points, int point_count)
	{
		return IntPtr(cvCreatePOSITObject((CvPoint3D32f*)points.ToPointer(), point_count));
	}

	/// <summary>
	/// Runs POSIT (POSe from ITeration) algorithm for determining 3d position of
	/// an object given its model and projection in a weak-perspective case
	/// </summary>
	/// <param name="posit_object"></param>
	/// <param name="image_points"></param>
	/// <param name="focal_length"></param>
	/// <param name="criteria"></param>
	/// <param name="rotation_matrix"></param>
	static void POSIT(IntPtr posit_object, IntPtr image_points, double focal_length, NAMESPACE::TermCriteria criteria, IntPtr rotation_matrix, IntPtr translation_vector)
	{
		cvPOSIT((CvPOSITObject*)posit_object.ToPointer(), (CvPoint2D32f*)image_points.ToPointer(), focal_length, *(CvTermCriteria*)&criteria, (CvMatr32f)rotation_matrix.ToPointer(), (CvVect32f)translation_vector.ToPointer());
	}

	/// <summary>
	/// Releases CvPOSITObject structure
	/// </summary>
	static void ReleasePOSITObject(IntPtr posit_object)
	{
		cvReleasePOSITObject((CvPOSITObject**)posit_object.ToPointer());
	}

	/// <summary>
	/// updates the number of RANSAC iterations
	/// </summary>
	/// <param name="p"></param>
	/// <param name="err_prob"></param>
	/// <param name="model_points"></param>
	/// <returns></returns>
	static int RANSACUpdateNumIters(double p, double err_prob, int model_points, int max_iters)
	{
		return cvRANSACUpdateNumIters(p, err_prob, model_points, max_iters);
	}

	/// <summary>
	/// </summary>
	/// <param name="src"></param>
	static void ConvertPointsHomogeneous(IntPtr src, IntPtr dst)
	{
		cvConvertPointsHomogeneous((CvMat*)src.ToPointer(), (CvMat*)dst.ToPointer());
	}

	/// <summary>
	/// </summary>
	/// <param name="points1"></param>
	/// <param name="points2"></param>
	/// <param name="fundamental_matrix"></param>
	/// <param name="method"></param>
	/// <param name="param1"></param>
	/// <param name="param2"></param>
	/// <returns></returns>
	static int FindFundamentalMat(IntPtr points1, IntPtr points2, IntPtr fundamental_matrix, FindFundamentalMatMethod method, double param1, double param2, IntPtr status)
	{
		return cvFindFundamentalMat((CvMat*)points1.ToPointer(), (CvMat*)points2.ToPointer(), (CvMat*)fundamental_matrix.ToPointer(), (int)method, param1, param2, (CvMat*)status.ToPointer());
	}

	/// <summary>
	/// </summary>
	/// <param name="points1"></param>
	/// <param name="points2"></param>
	/// <param name="fundamental_matrix"></param>
	/// <param name="method"></param>
	/// <param name="param1"></param>
	/// <returns></returns>
	static int FindFundamentalMat(IntPtr points1, IntPtr points2, IntPtr fundamental_matrix, FindFundamentalMatMethod method, double param1, double param2)
	{
		return cvFindFundamentalMat((CvMat*)points1.ToPointer(), (CvMat*)points2.ToPointer(), (CvMat*)fundamental_matrix.ToPointer(), (int)method, param1, param2);
	}

	/// <summary>
	/// </summary>
	/// <param name="points1"></param>
	/// <param name="points2"></param>
	/// <param name="fundamental_matrix"></param>
	/// <param name="method"></param>
	/// <returns></returns>
	static int FindFundamentalMat(IntPtr points1, IntPtr points2, IntPtr fundamental_matrix, FindFundamentalMatMethod method, double param1)
	{
		return cvFindFundamentalMat((CvMat*)points1.ToPointer(), (CvMat*)points2.ToPointer(), (CvMat*)fundamental_matrix.ToPointer(), (int)method, param1);
	}

	/// <summary>
	/// </summary>
	/// <param name="points1"></param>
	/// <param name="points2"></param>
	/// <param name="fundamental_matrix"></param>
	/// <returns></returns>
	static int FindFundamentalMat(IntPtr points1, IntPtr points2, IntPtr fundamental_matrix, FindFundamentalMatMethod method)
	{
		return cvFindFundamentalMat((CvMat*)points1.ToPointer(), (CvMat*)points2.ToPointer(), (CvMat*)fundamental_matrix.ToPointer(), (int)method);
	}

	/// <summary>
	/// </summary>
	/// <param name="points1"></param>
	/// <param name="points2"></param>
	/// <returns></returns>
	static int FindFundamentalMat(IntPtr points1, IntPtr points2, IntPtr fundamental_matrix)
	{
		return cvFindFundamentalMat((CvMat*)points1.ToPointer(), (CvMat*)points2.ToPointer(), (CvMat*)fundamental_matrix.ToPointer());
	}

	/// <summary>
	/// For each input point on one of images
	/// computes parameters of the corresponding
	/// epipolar line on the other image
	/// </summary>
	/// <param name="points"></param>
	/// <param name="which_image"></param>
	/// <param name="fundamental_matrix"></param>
	static void ComputeCorrespondEpilines(IntPtr points, int which_image, IntPtr fundamental_matrix, IntPtr correspondent_lines)
	{
		cvComputeCorrespondEpilines((CvMat*)points.ToPointer(), which_image, (CvMat*)fundamental_matrix.ToPointer(), (CvMat*)correspondent_lines.ToPointer());
	}

	/// <summary>
	/// Triangulation functions
	/// </summary>
	/// <param name="projMatr1"></param>
	/// <param name="projMatr2"></param>
	/// <param name="projPoints1"></param>
	/// <param name="projPoints2"></param>
	static void TriangulatePoints(IntPtr projMatr1, IntPtr projMatr2, IntPtr projPoints1, IntPtr projPoints2, IntPtr points4D)
	{
		cvTriangulatePoints((CvMat*)projMatr1.ToPointer(), (CvMat*)projMatr2.ToPointer(), (CvMat*)projPoints1.ToPointer(), (CvMat*)projPoints2.ToPointer(), (CvMat*)points4D.ToPointer());
	}

	/// <summary>
	/// </summary>
	/// <param name="F"></param>
	/// <param name="points1"></param>
	/// <param name="points2"></param>
	/// <param name="new_points1"></param>
	static void CorrectMatches(IntPtr F, IntPtr points1, IntPtr points2, IntPtr new_points1, IntPtr new_points2)
	{
		cvCorrectMatches((CvMat*)F.ToPointer(), (CvMat*)points1.ToPointer(), (CvMat*)points2.ToPointer(), (CvMat*)new_points1.ToPointer(), (CvMat*)new_points2.ToPointer());
	}

	/// <summary>
	/// </summary>
	/// <param name="preset"></param>
	/// <returns></returns>
	static IntPtr CreateStereoBMState(StereoBlockMatchMode preset, int numberOfDisparities)
	{
		return IntPtr(cvCreateStereoBMState((int)preset, numberOfDisparities));
	}

	/// <summary>
	/// </summary>
	/// <returns></returns>
	static IntPtr CreateStereoBMState(StereoBlockMatchMode preset)
	{
		return IntPtr(cvCreateStereoBMState((int)preset));
	}

	/// <summary>
	/// </summary>
	/// <returns></returns>
	static IntPtr CreateStereoBMState()
	{
		return IntPtr(cvCreateStereoBMState());
	}

	/// <summary>
	/// </summary>
	static void ReleaseStereoBMState(IntPtr state)
	{
		cvReleaseStereoBMState((CvStereoBMState**)state.ToPointer());
	}

	/// <summary>
	/// </summary>
	/// <param name="left"></param>
	/// <param name="right"></param>
	/// <param name="disparity"></param>
	static void FindStereoCorrespondenceBM(IntPtr left, IntPtr right, IntPtr disparity, IntPtr state)
	{
		cvFindStereoCorrespondenceBM((CvArr*)left.ToPointer(), (CvArr*)right.ToPointer(), (CvArr*)disparity.ToPointer(), (CvStereoBMState*)state.ToPointer());
	}

	/// <summary>
	/// </summary>
	/// <param name="numberOfDisparities"></param>
	/// <returns></returns>
	static IntPtr CreateStereoGCState(int numberOfDisparities, int maxIters)
	{
		return IntPtr(cvCreateStereoGCState(numberOfDisparities, maxIters));
	}

	/// <summary>
	/// </summary>
	static void ReleaseStereoGCState(IntPtr state)
	{
		cvReleaseStereoGCState((CvStereoGCState**)state.ToPointer());
	}

	/// <summary>
	/// </summary>
	/// <param name="left"></param>
	/// <param name="right"></param>
	/// <param name="disparityLeft"></param>
	/// <param name="disparityRight"></param>
	/// <param name="state"></param>
	static void FindStereoCorrespondenceGC(IntPtr left, IntPtr right, IntPtr disparityLeft, IntPtr disparityRight, IntPtr state, int useDisparityGuess)
	{
		cvFindStereoCorrespondenceGC((CvArr*)left.ToPointer(), (CvArr*)right.ToPointer(), (CvArr*)disparityLeft.ToPointer(), (CvArr*)disparityRight.ToPointer(), (CvStereoGCState*)state.ToPointer(), useDisparityGuess);
	}

	/// <summary>
	/// </summary>
	/// <param name="left"></param>
	/// <param name="right"></param>
	/// <param name="disparityLeft"></param>
	/// <param name="disparityRight"></param>
	static void FindStereoCorrespondenceGC(IntPtr left, IntPtr right, IntPtr disparityLeft, IntPtr disparityRight, IntPtr state)
	{
		cvFindStereoCorrespondenceGC((CvArr*)left.ToPointer(), (CvArr*)right.ToPointer(), (CvArr*)disparityLeft.ToPointer(), (CvArr*)disparityRight.ToPointer(), (CvStereoGCState*)state.ToPointer());
	}

	/// <summary>
	/// Reprojects the computed disparity image to the 3D space using the specified 4x4 matrix
	/// </summary>
	/// <param name="disparityImage"></param>
	/// <param name="_3dImage"></param>
	/// <param name="Q"></param>
	static void ReprojectImageTo3D(IntPtr disparityImage, IntPtr _3dImage, IntPtr Q, bool handleMissingValues)
	{
		cvReprojectImageTo3D((CvArr*)disparityImage.ToPointer(), (CvArr*)_3dImage.ToPointer(), (CvMat*)Q.ToPointer(), (int)handleMissingValues);
	}

	/// <summary>
	/// Reprojects the computed disparity image to the 3D space using the specified 4x4 matrix
	/// </summary>
	/// <param name="disparityImage"></param>
	/// <param name="_3dImage"></param>
	static void ReprojectImageTo3D(IntPtr disparityImage, IntPtr _3dImage, IntPtr Q)
	{
		cvReprojectImageTo3D((CvArr*)disparityImage.ToPointer(), (CvArr*)_3dImage.ToPointer(), (CvMat*)Q.ToPointer());
	}

//////////////////////////////////////////////////////////////////////////